Unverified Commit 26eb4ce3 authored by Harkrishn Patro's avatar Harkrishn Patro Committed by GitHub
Browse files

Fix defrag test (#12674)

Fixing issues started after #11695 when the defrag tests are being executed in cluster mode too.
For some reason, it looks like the defragmentation is over too quickly, before the test is able to
detect that it's running.
so now instead of waiting to see that it's active, we wait to see that it did some work
```
[err]: Active defrag big list: cluster in tests/unit/memefficiency.tcl
defrag not started.
[err]: Active defrag big keys: cluster in tests/unit/memefficiency.tcl
defrag didn't stop.
```
parent becd50d0
...@@ -71,8 +71,12 @@ run_solo {defrag} { ...@@ -71,8 +71,12 @@ run_solo {defrag} {
# Wait for the active defrag to start working (decision once a # Wait for the active defrag to start working (decision once a
# second). # second).
wait_for_condition 50 100 { wait_for_condition 50 100 {
[s active_defrag_running] ne 0 [s total_active_defrag_time] ne 0
} else { } else {
after 120 ;# serverCron only updates the info once in 100ms
puts [r info memory]
puts [r info stats]
puts [r memory malloc-stats]
fail "defrag not started." fail "defrag not started."
} }
...@@ -218,8 +222,12 @@ run_solo {defrag} { ...@@ -218,8 +222,12 @@ run_solo {defrag} {
# wait for the active defrag to start working (decision once a second) # wait for the active defrag to start working (decision once a second)
wait_for_condition 50 100 { wait_for_condition 50 100 {
[s active_defrag_running] ne 0 [s total_active_defrag_time] ne 0
} else { } else {
after 120 ;# serverCron only updates the info once in 100ms
puts [r info memory]
puts [r info stats]
puts [r memory malloc-stats]
fail "defrag not started." fail "defrag not started."
} }
...@@ -336,8 +344,12 @@ run_solo {defrag} { ...@@ -336,8 +344,12 @@ run_solo {defrag} {
if {[r config get activedefrag] eq "activedefrag yes"} { if {[r config get activedefrag] eq "activedefrag yes"} {
# wait for the active defrag to start working (decision once a second) # wait for the active defrag to start working (decision once a second)
wait_for_condition 50 100 { wait_for_condition 50 100 {
[s active_defrag_running] ne 0 [s total_active_defrag_time] ne 0
} else { } else {
after 120 ;# serverCron only updates the info once in 100ms
puts [r info memory]
puts [r info stats]
puts [r memory malloc-stats]
fail "defrag not started." fail "defrag not started."
} }
...@@ -432,8 +444,12 @@ run_solo {defrag} { ...@@ -432,8 +444,12 @@ run_solo {defrag} {
if {[r config get activedefrag] eq "activedefrag yes"} { if {[r config get activedefrag] eq "activedefrag yes"} {
# wait for the active defrag to start working (decision once a second) # wait for the active defrag to start working (decision once a second)
wait_for_condition 50 100 { wait_for_condition 50 100 {
[s active_defrag_running] ne 0 [s total_active_defrag_time] ne 0
} else { } else {
after 120 ;# serverCron only updates the info once in 100ms
puts [r info memory]
puts [r info stats]
puts [r memory malloc-stats]
fail "defrag not started." fail "defrag not started."
} }
...@@ -552,8 +568,12 @@ run_solo {defrag} { ...@@ -552,8 +568,12 @@ run_solo {defrag} {
if {[r config get activedefrag] eq "activedefrag yes"} { if {[r config get activedefrag] eq "activedefrag yes"} {
# wait for the active defrag to start working (decision once a second) # wait for the active defrag to start working (decision once a second)
wait_for_condition 50 100 { wait_for_condition 50 100 {
[s active_defrag_running] ne 0 [s total_active_defrag_time] ne 0
} else { } else {
after 120 ;# serverCron only updates the info once in 100ms
puts [r info memory]
puts [r info stats]
puts [r memory malloc-stats]
fail "defrag not started." fail "defrag not started."
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment