diff --git a/tests/unit/querybuf.tcl b/tests/unit/querybuf.tcl index 7e04b87905..913b993b1b 100644 --- a/tests/unit/querybuf.tcl +++ b/tests/unit/querybuf.tcl @@ -33,6 +33,9 @@ start_server {tags {"querybuf slow"}} { # Make sure query buff has size of 0 bytes at start as the client uses the shared qb. assert {[client_query_buffer test_client] == 0} + # Pause cron to prevent premature shrinking (timing issue). + r debug pause-cron 1 + # Send partial command to client to make sure it doesn't use the shared qb. $rd write "*3\r\n\$3\r\nset\r\n\$2\r\na" $rd flush @@ -48,6 +51,9 @@ start_server {tags {"querybuf slow"}} { set MAX_QUERY_BUFFER_SIZE [expr 32768 + 2] ; # 32k + 2, allowing for potential greedy allocation of (16k + 1) * 2 bytes for the query buffer. assert {$orig_test_client_qbuf >= 16384 && $orig_test_client_qbuf <= $MAX_QUERY_BUFFER_SIZE} + # Allow shrinking to occur + r debug pause-cron 0 + # Check that the initial query buffer is resized after 2 sec wait_for_condition 1000 10 { [client_idle_sec test_client] >= 3 && [client_query_buffer test_client] < $orig_test_client_qbuf