Quick fix to make psync tests work
This commit is contained in:
parent
07ffc4b380
commit
fb8a0ad373
18
tests/helpers/gen_climbing_load.tcl
Normal file
18
tests/helpers/gen_climbing_load.tcl
Normal file
@ -0,0 +1,18 @@
|
||||
source tests/support/keydb.tcl
|
||||
|
||||
|
||||
set ::tlsdir "tests/tls"
|
||||
|
||||
proc gen_climbing_load {host port db ops tls} {
|
||||
set start_time [clock seconds]
|
||||
set r [redis $host $port 1 $tls]
|
||||
$r client setname LOAD_HANDLER
|
||||
$r select $db
|
||||
set x 0
|
||||
while {$x < $ops} {
|
||||
incr x
|
||||
$r set [expr $x] [expr rand()]
|
||||
}
|
||||
}
|
||||
|
||||
gen_climbing_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3] [lindex $argv 4]
|
@ -76,9 +76,9 @@ proc test_psync {descr duration backlog_size backlog_ttl delay cond mdl sdl reco
|
||||
}
|
||||
}
|
||||
}
|
||||
stop_bg_complex_data $load_handle0
|
||||
stop_bg_complex_data $load_handle1
|
||||
stop_bg_complex_data $load_handle2
|
||||
stop_climbing_load $load_handle0
|
||||
stop_climbing_load $load_handle1
|
||||
stop_climbing_load $load_handle2
|
||||
|
||||
# Wait for the replica to reach the "online"
|
||||
# state from the POV of the master.
|
||||
@ -147,4 +147,4 @@ foreach mdl {no yes} {
|
||||
assert {[s -1 sync_partial_err] > 0}
|
||||
} $mdl $sdl 1
|
||||
}
|
||||
}
|
||||
}
|
@ -543,11 +543,20 @@ proc start_bg_complex_data {host port db ops} {
|
||||
exec $tclsh tests/helpers/bg_complex_data.tcl $host $port $db $ops $::tls &
|
||||
}
|
||||
|
||||
proc start_climbing_load {host port db ops} {
|
||||
set tclsh [info nameofexecutable]
|
||||
exec $tclsh tests/helpers/gen_climbing_load.tcl $host $port $db $ops $::tls &
|
||||
}
|
||||
|
||||
# Stop a process generating write load executed with start_bg_complex_data.
|
||||
proc stop_bg_complex_data {handle} {
|
||||
catch {exec /bin/kill -9 $handle}
|
||||
}
|
||||
|
||||
proc stop_climbing_load {handle} {
|
||||
catch {exec /bin/kill -9 $handle}
|
||||
}
|
||||
|
||||
proc populate {num prefix size} {
|
||||
set rd [redis_deferring_client]
|
||||
for {set j 0} {$j < $num} {incr j} {
|
||||
|
Loading…
x
Reference in New Issue
Block a user