Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
92af219
[fix] stabilize flaky Tcl CI test cases
warrick1016 Jul 7, 2026
7c967c4
[fix] flaky1 dirty
warrick1016 Jul 7, 2026
fd65d54
[fix] flaky2 logging.tcl
warrick1016 Jul 7, 2026
c5b5756
[fix] flaky3 client-evict.tcl
warrick1016 Jul 8, 2026
a627e57
[fix] flaky4 client-evict.tcl
warrick1016 Jul 8, 2026
5b591b1
[fix] flaky4 tests/integration/replication.tcl
warrick1016 Jul 8, 2026
6b5314e
[fix] flaky5 rdb.tcl && compact_range.tcl
warrick1016 Jul 8, 2026
040de7d
[fix] flaky6 evict.tcl && memefficiency.tcl
warrick1016 Jul 8, 2026
ccd6dda
[fix] flaky7 tests/integration/replication.tcl && tests/swap/integrat…
warrick1016 Jul 8, 2026
0baf236
[fix] flaky8 tests/integration/replication.tcl && tests/integration/r…
warrick1016 Jul 8, 2026
d8af964
[fix] flaky9 tests/integration/rdb.tcl
warrick1016 Jul 8, 2026
c4326aa
[fix] flaky10 server.tcl
warrick1016 Jul 8, 2026
9725816
[fix] flaky11 tests/unit/client-evict.tcl
warrick1016 Jul 8, 2026
9c93ed9
[fix] flaky12 tests/unit/client-evict.tcl
warrick1016 Jul 8, 2026
63a24fd
[fix] flaky13 replication.tcl replication-psync.tcl
warrick1016 Jul 9, 2026
e761791
[fix] flaky14 rdb.tcl persist.tcl swap_error.tcl
warrick1016 Jul 9, 2026
85a3eac
[fix] flaky15 tests/integration/replication.tcl
warrick1016 Jul 9, 2026
1f9309c
[fix] flaky16 tests/integration/replication.tcl
warrick1016 Jul 9, 2026
989df85
[fix] flaky17 replication-psync.tcl shutdown.tcl
warrick1016 Jul 9, 2026
7279f0d
[fix] flaky18 tests/swap/integration/bgsave.tcl
warrick1016 Jul 9, 2026
391a488
[fix] flaky19 tests/unit/multi.tcl tests/integration/rdb.tcl tests/un…
warrick1016 Jul 9, 2026
43a8e81
[fix] flaky20 tests/integration/rdb.tcl
warrick1016 Jul 10, 2026
569df16
[fix] flaky21 tests/unit/client-evict.tcl tests/integration/replicati…
warrick1016 Jul 10, 2026
41657eb
[fix] flaky22 tests/swap/integration/persist.tcl tests/swap/ported/in…
warrick1016 Jul 10, 2026
f50f5bb
[fix] flaky23 back to /root/Redis-on-Rocks/
warrick1016 Jul 10, 2026
31132e4
[fix] flaky24 keep up with 8.x
warrick1016 Jul 10, 2026
83dad95
[fix] flaky25 tests/support/util.tcl
warrick1016 Jul 10, 2026
1829308
[fix] flaky26 tests/integration/replication.tcl
warrick1016 Jul 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/integration/block-repl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ start_server {tags {"repl" "memonly"}} {

test {First server should have role slave after SLAVEOF} {
$slave slaveof $master_host $master_port
after 1000
wait_for_condition 50 100 {
[s 0 role] eq "slave"
} else {
fail "First server should have role slave after SLAVEOF"
}
s 0 role
} {slave}

Expand Down
22 changes: 6 additions & 16 deletions tests/integration/logging.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,7 @@ if {$system_supported} {
test "Server is able to generate a stack trace on selected systems" {
r config set watchdog-period 200
r debug sleep 1
set pattern "*debugCommand*"
set retry 10
while {$retry} {
set result [exec tail -100 < [srv 0 stdout]]
if {[string match $pattern $result]} {
break
}
incr retry -1
after 1000
}
if {$retry == 0} {
error "assertion:expected stack trace not found into log file"
}
wait_for_log_messages 0 {"*debugCommand*"} 0 1000 10
}
}

Expand All @@ -41,10 +29,12 @@ if {$system_supported} {
start_server [list overrides [list dir $server_path] tags {"nosanitizer"}] {
test "Crash report generated on SIGABRT" {
set pid [s process_id]
r deferred 1
r debug sleep 10
r flush
after 100
exec kill -SIGABRT $pid
set pattern "*STACK TRACE*"
set result [exec tail -1000 < [srv 0 stdout]]
assert {[string match $pattern $result]}
wait_for_log_messages 0 {"*STACK TRACE*"} 0 100 50
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/psync2-reg.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ start_server {} {
wait_for_condition 50 1000 {
[status $R(1) master_link_status] == "up" &&
[status $R(2) master_link_status] == "up" &&
[$R(1) dbsize] == 1 &&
[$R(2) dbsize] == 1
[dbsize_loadsafe $R(1) replica1_dbsize] &&
[dbsize_loadsafe $R(2) replica2_dbsize] &&
$replica1_dbsize == 1 &&
$replica2_dbsize == 1
} else {
fail "Replicas not replicating from master"
}
Expand Down
111 changes: 86 additions & 25 deletions tests/integration/rdb.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,22 @@ start_server {} {
}
}

tags {memonly} {
test {client freed during loading} {
start_server [list overrides [list key-load-delay 10 rdbcompression no]] {
start_server [list overrides [list key-load-delay 50 rdbcompression no save "900 1"]] {
# create a big rdb that will take long to load. it is important
# for keys to be big since the server processes events only once in 2mb.
# 100mb of rdb, 100k keys will load in more than 1 second
# 100mb of rdb, 100k keys will load in more than 5 seconds
r debug populate 100000 key 1000

restart_server 0 false false

# make sure it's still loading
assert_equal [s loading] 1

# connect and disconnect 10 clients
# connect and disconnect 5 clients
set clients {}
for {set j 0} {$j < 10} {incr j} {
for {set j 0} {$j < 5} {incr j} {
lappend clients [redis_deferring_client]
}
foreach rd $clients {
Expand All @@ -203,13 +204,18 @@ test {client freed during loading} {
exec kill [srv 0 pid]
}
}
}

# Our COW metrics (Private_Dirty) work only on Linux
set system_name [string tolower [exec uname -s]]
if {$system_name eq {linux}} {
set page_size [exec getconf PAGESIZE]
if {$system_name eq {linux} && $page_size == 4096} {

start_server {overrides {save ""}} {
test {Test child sending info} {
if {$::swap == 1} {
r config set swap-repl-rordb-sync no
}
# make sure that rdb_last_cow_size and current_cow_size are zero (the test using new server),
# so that the comparisons during the test will be valid
assert {[s current_cow_size] == 0}
Expand All @@ -220,12 +226,17 @@ start_server {overrides {save ""}} {

# using a 200us delay, the bgsave is empirically taking about 10 seconds.
# we need it to take more than some 5 seconds, since redis only report COW once a second.
r config set rdb-key-save-delay 200
if {$::swap == 1} {
r config set swap-debug-rdb-key-save-delay-micro 200
} else {
r config set rdb-key-save-delay 200
}
r config set loglevel debug

# populate the db with 10k keys of 4k each
# Use small values so copy-on-write growth is observable without
# letting allocator side effects dominate the measurement.
set rd [redis_deferring_client 0]
set size 4096
set size 500
set cmd_count 10000
for {set k 0} {$k < $cmd_count} {incr k} {
$rd set key$k [string repeat A $size]
Expand All @@ -248,6 +259,7 @@ start_server {overrides {save ""}} {
# on each iteration, we will write some key to the server to trigger copy-on-write, and
# wait to see that it reflected in INFO.
set iteration 1
set key_idx 0
while 1 {
# take samples before writing new data to the server
set cow_size [s current_cow_size]
Expand All @@ -261,20 +273,54 @@ start_server {overrides {save ""}} {
}

# trigger copy-on-write
r setrange key$iteration 0 [string repeat B $size]

# wait to see that current_cow_size value updated (as long as the child is in progress)
wait_for_condition 80 100 {
[s rdb_bgsave_in_progress] == 0 ||
[s current_cow_size] >= $cow_size + $size &&
[s current_save_keys_processed] > $keys_processed &&
[s current_fork_perc] > 0
set modified_keys 16
for {set k 0} {$k < $modified_keys} {incr k} {
r setrange key$key_idx 0 [string repeat B $size]
incr key_idx 1
}

# 16 modified 512-byte-ish values should dirty at least 2 pages.
# Keep the assertion loose and only require one page of visible growth.
set exp_cow [expr {$cow_size + 4096}]
# wait to see that child INFO fields were updated (as long as the
# child is in progress). Under swap+asan, /proc/self/smaps parsing
# plus the COW duty-cycle throttle can delay or suppress the next
# current_cow_size byte-growth sample for a very long time even
# though the child is already reporting progress. In that mode,
# treat keys_processed/current_fork_perc progress as sufficient.
if {$::asan && $::swap} {
set wait_iters 1800
wait_for_condition $wait_iters 100 {
[s rdb_bgsave_in_progress] == 0 ||
[s current_save_keys_processed] > $keys_processed &&
[s current_fork_perc] > 0
} else {
if {$::verbose} {
puts "COW info on fail: [s current_cow_size]"
puts [exec tail -n 100 < [srv 0 stdout]]
}
fail "COW info wasn't reported"
}
} else {
if {$::verbose} {
puts "COW info on fail: [s current_cow_size]"
puts [exec tail -n 100 < [srv 0 stdout]]
# Under ASAN, /proc/self/smaps parsing is slow (ASAN doubles
# virtual address space). The COW duty-cycle throttle
# (CHILD_COW_DUTY_CYCLE=100) suppresses subsequent measurements
# for 100x the parse time, so a single measurement can suppress
# the next one for minutes. Use a longer timeout to absorb the
# first slow reading.
set wait_iters [expr {$::asan ? 300 : 80}]
wait_for_condition $wait_iters 100 {
[s rdb_bgsave_in_progress] == 0 ||
[s current_cow_size] >= $exp_cow &&
[s current_save_keys_processed] > $keys_processed &&
[s current_fork_perc] > 0
} else {
if {$::verbose} {
puts "COW info on fail: [s current_cow_size]"
puts [exec tail -n 100 < [srv 0 stdout]]
}
fail "COW info wasn't reported"
}
fail "COW info wasn't reported"
}

# assert that $keys_processed is not greater than total keys.
Expand All @@ -291,23 +337,38 @@ start_server {overrides {save ""}} {
}

incr iteration 1

# Under ASAN, one successful observation is enough. Reading COW
# info is slow there, and the next measurement may be throttled
# for a long time.
if {$::asan} {
break
}
}

# make sure we saw report of current_cow_size
if {$iteration < 2 && $::verbose} {
puts [exec tail -n 100 < [srv 0 stdout]]
}
assert_morethan_equal $iteration 2
if {$::asan} {
assert {$iteration >= 1}
} else {
assert_morethan_equal $iteration 2
}

# if bgsave completed, check that rdb_last_cow_size (fork exit report)
# is at least 90% of last rdb_active_cow_size.
if { [s rdb_bgsave_in_progress] == 0 } {
set final_cow [s rdb_last_cow_size]
set cow_size [expr $cow_size * 0.9]
if {$final_cow < $cow_size && $::verbose} {
puts [exec tail -n 100 < [srv 0 stdout]]
if {$::asan} {
assert {$final_cow > 0}
} else {
set cow_size [expr $cow_size * 0.9]
if {$final_cow < $cow_size && $::verbose} {
puts [exec tail -n 100 < [srv 0 stdout]]
}
assert_morethan_equal $final_cow $cow_size
}
assert_morethan_equal $final_cow $cow_size
}
}
}
Expand Down
Loading
Loading