Fix timing issue for module defrag test (#14305)

These two tests often fail in the slow environment.
1. `Module defrag: late defrag with cursor works` test
`defragtest_datatype_resumes` in a defrag cycle does not always reach 10
times, so increase the threshold and move the assertion of
`defragtest_datatype_resumes` to `wait_for_condition`.

2. `Module defrag: global defrag works` test
     Increase the waiting time for this test.
This commit is contained in:
debing.sun 2025-08-27 22:25:32 +08:00 committed by GitHub
parent 35aacdf80a
commit e2b8f8ff6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,14 +54,14 @@ start_server {tags {"modules external:skip"} overrides {{save ""}}} {
r frag.create key2 10000 100 1000
r config set activedefrag yes
wait_for_condition 200 50 {
[getInfoProperty [r info defragtest_stats] defragtest_defrag_ended] > 0
wait_for_condition 1000 50 {
[getInfoProperty [r info defragtest_stats] defragtest_defrag_ended] > 0 &&
[getInfoProperty [r info defragtest_stats] defragtest_datatype_resumes] > 10
} else {
fail "Unable to wait for a complete defragmentation cycle to finish"
}
set info [r info defragtest_stats]
assert {[getInfoProperty $info defragtest_datatype_resumes] > 10}
assert_equal 0 [getInfoProperty $info defragtest_datatype_wrong_cursor]
assert_morethan [getInfoProperty $info defragtest_datatype_raw_defragged] 0
assert_morethan [getInfoProperty $info defragtest_defrag_started] 0
@ -81,7 +81,7 @@ start_server {tags {"modules external:skip"} overrides {{save ""}}} {
r frag.create_frag_global 50000
r config set activedefrag yes
wait_for_condition 200 50 {
wait_for_condition 1000 50 {
[getInfoProperty [r info defragtest_stats] defragtest_defrag_ended] > 0
} else {
fail "Unable to wait for a complete defragmentation cycle to finish"