From 45d83fb2d49c9d44249265b3ccb63cd39fa50501 Mon Sep 17 00:00:00 2001 From: Binbin Date: Mon, 7 Mar 2022 19:44:07 +0800 Subject: [PATCH] Fix timing issue in rehash test (#10388) `Expected '*table size: 4096*' to match '*table size: 8192*'` This test failed once on daily macOS, the reason is because the bgsave has not stopped after the kill and `after 200`. So there is a child process and no rehash triggered. This commit use `waitForBgsave` to wait for it to finish. --- tests/unit/other.tcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/other.tcl b/tests/unit/other.tcl index f4d540fcf1..258ef2f6e1 100644 --- a/tests/unit/other.tcl +++ b/tests/unit/other.tcl @@ -332,7 +332,8 @@ start_server {tags {"other external:skip"}} { # Hash table should not rehash assert_no_match "*table size: 8192*" [r debug HTSTATS 9] exec kill -9 [get_child_pid 0] - after 200 + waitForBgsave r + after 200 ;# waiting for serverCron # Hash table should rehash since there is no child process, # size is power of two and over 4098, so it is 8192