Skip to content

Commit 89d4577

Browse files
authored
Fix flaky shutdown tests caused by timing issue (#1960)
This started failing after ee9a305, since processing of SHUTDOWN might happen after the CLIENT INFO is retrieved. Now we use wait_for_condition to make sure CLIENT INFO is retried in the case that SHUTDOWN is not processed yet. Signed-off-by: Jacob Murphy <jkmurphy@google.com>
1 parent 30dc9a7 commit 89d4577

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/integration/shutdown.tcl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,12 @@ test "Shutting down primary wait for replica after previous block" {
269269
# Call shutdown.
270270
$primary_deferring shutdown
271271

272-
set info_clients [$primary info clients]
273-
assert_match "*connected_clients:2*" $info_clients
274-
assert_match "*blocked_clients:1*" $info_clients
272+
wait_for_condition 100 100 {
273+
[string match "*connected_clients:2*" [$primary info clients]] && [string match "*blocked_clients:1*" [$primary info clients]]
274+
} else {
275+
set client_info [$primary info clients]
276+
fail "Shutdown did not trigger block. Current INFO CLIENTS output: $client_info"
277+
}
275278

276279
# Wake up replica, causing primary to continue shutting down.
277280
resume_process $replica_pid

0 commit comments

Comments
 (0)