Fix race condition in lazy free test (#9682)

The first test exited before all the memory was reclaimed, so when the second test
sampled used_memory, it was too early.
This commit is contained in:
Oran Agra 2021-10-26 13:02:31 +03:00 committed by GitHub
parent 665e428435
commit 37559ca79f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,13 @@ start_server {tags {"lazyfree"}} {
}
test "FLUSHDB ASYNC can reclaim memory in background" {
# make the previous test is really done before sampling used_memory
wait_for_condition 50 100 {
[s lazyfree_pending_objects] == 0
} else {
fail "lazyfree isn't done"
}
set orig_mem [s used_memory]
set args {}
for {set i 0} {$i < 100000} {incr i} {