2024-04-24 18:54:52 +00:00
|
|
|
source tests/support/valkey.tcl
|
2012-01-06 16:28:40 +00:00
|
|
|
|
2019-09-12 07:56:54 +00:00
|
|
|
set ::tlsdir "tests/tls"
|
|
|
|
|
|
|
|
proc gen_write_load {host port seconds tls} {
|
2012-01-06 16:28:40 +00:00
|
|
|
set start_time [clock seconds]
|
2024-04-18 13:57:17 +00:00
|
|
|
set r [valkey $host $port 1 $tls]
|
stabilize tests that involved with load handlers (#8967)
When test stop 'load handler' by killing the process that generating the load,
some commands that already in the input buffer, still might be processed by the server.
This may cause some instability in tests, that count on that no more commands
processed after we stop the `load handler'
In this commit, new proc 'wait_load_handlers_disconnected' added, to verify that no more
cammands from any 'load handler' prossesed, by checking that the clients who
genreate the load is disconnceted.
Also, replacing check of dbsize with wait_for_ofs_sync before comparing debug digest, as
it would fail in case the last key the workload wrote was an overridden key (not a new one).
Affected tests
Race fix:
- failover command to specific replica works
- Connect multiple replicas at the same time (issue #141), master diskless=$mdl, replica diskless=$sdl
- AOF rewrite during write load: RDB preamble=$rdbpre
Cleanup and speedup:
- Test replication with blocking lists and sorted sets operations
- Test replication with parallel clients writing in different DBs
- Test replication partial resync: $descr (diskless: $mdl, $sdl, reconnect: $reconnect
2021-05-20 12:29:43 +00:00
|
|
|
$r client setname LOAD_HANDLER
|
2012-01-06 16:28:40 +00:00
|
|
|
$r select 9
|
|
|
|
while 1 {
|
|
|
|
$r set [expr rand()] [expr rand()]
|
|
|
|
if {[clock seconds]-$start_time > $seconds} {
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-12 07:56:54 +00:00
|
|
|
gen_write_load [lindex $argv 0] [lindex $argv 1] [lindex $argv 2] [lindex $argv 3]
|