diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl index 2ba7c2af158..8a722698c4a 100644 --- a/tests/integration/replication.tcl +++ b/tests/integration/replication.tcl @@ -1551,7 +1551,9 @@ foreach disklessload {disabled on-empty-db} { $replica config set repl-diskless-load $disklessload # Populate replica with many keys, master with a few keys. - $replica debug populate 4000000 + # Using 500K keys instead of 4M to reduce test time while still + # creating a sufficient LOADING window for high-frequency polling. + $replica debug populate 500000 populate 3 master 10 # Start the replication process... @@ -1571,14 +1573,12 @@ foreach disklessload {disabled on-empty-db} { # Discarding old db will take a long time and loading new one # will be quick. So, if we receive -LOADING, most probably it is # when flushing the db. - wait_for_condition 1 10000 { + # The LOADING window can be very brief (milliseconds on fast hardware), + # so we use high-frequency polling to reliably catch it. + wait_for_condition 1000 10 { [catch {$replica ping} err] && [string match *LOADING* $err] } else { - # There is a chance that we may not catch LOADING response - # if flushing db happens too fast compared to test execution - # Then, we may consider increasing key count or introducing - # artificial delay to db flush. fail "Replica did not reply LOADING." }