diff options
author | antirez <antirez@gmail.com> | 2017-04-22 15:59:53 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2017-04-22 15:59:57 +0200 |
commit | c861e1e1eee2c29c1df36759d471f6758048318f (patch) | |
tree | f3f3710796601e9967aab911cf25db093e6fccdc | |
parent | a17390853dfa294b26167eed59b81379dc833a52 (diff) | |
download | redis-c861e1e1eee2c29c1df36759d471f6758048318f.tar.gz |
Defrag: test currently disabled, too many false positives.
Related to #3786.
-rw-r--r-- | tests/unit/memefficiency.tcl | 78 |
1 files changed, 40 insertions, 38 deletions
diff --git a/tests/unit/memefficiency.tcl b/tests/unit/memefficiency.tcl index 5f0bed176..f452f0224 100644 --- a/tests/unit/memefficiency.tcl +++ b/tests/unit/memefficiency.tcl @@ -36,48 +36,50 @@ start_server {tags {"memefficiency"}} { } } -start_server {tags {"defrag"}} { - if {[string match {*jemalloc*} [s mem_allocator]]} { - test "Active defrag" { - r config set activedefrag no - r config set active-defrag-threshold-lower 5 - r config set active-defrag-ignore-bytes 2mb - r config set maxmemory 100mb - r config set maxmemory-policy allkeys-lru - r debug populate 700000 asdf 150 - r debug populate 170000 asdf 300 - set frag [s mem_fragmentation_ratio] - assert {$frag >= 1.7} - r config set activedefrag yes - after 1500 ;# active defrag tests the status once a second. - set hits [s active_defrag_hits] - - # wait for the active defrag to stop working - set tries 0 - while { True } { - incr tries - after 500 - set prev_hits $hits +if 0 { + start_server {tags {"defrag"}} { + if {[string match {*jemalloc*} [s mem_allocator]]} { + test "Active defrag" { + r config set activedefrag no + r config set active-defrag-threshold-lower 5 + r config set active-defrag-ignore-bytes 2mb + r config set maxmemory 100mb + r config set maxmemory-policy allkeys-lru + r debug populate 700000 asdf 150 + r debug populate 170000 asdf 300 + set frag [s mem_fragmentation_ratio] + assert {$frag >= 1.7} + r config set activedefrag yes + after 1500 ;# active defrag tests the status once a second. set hits [s active_defrag_hits] - if {$hits == $prev_hits} { - break + + # wait for the active defrag to stop working + set tries 0 + while { True } { + incr tries + after 500 + set prev_hits $hits + set hits [s active_defrag_hits] + if {$hits == $prev_hits} { + break + } + assert {$tries < 100} } - assert {$tries < 100} - } - # TODO: we need to expose more accurate fragmentation info - # i.e. the allocator used and active pages - # instead we currently look at RSS so we need to ask for purge - r memory purge + # TODO: we need to expose more accurate fragmentation info + # i.e. the allocator used and active pages + # instead we currently look at RSS so we need to ask for purge + r memory purge - # Test the the fragmentation is lower and that the defragger - # stopped working - set frag [s mem_fragmentation_ratio] - assert {$frag < 1.55} - set misses [s active_defrag_misses] - after 500 - set misses2 [s active_defrag_misses] - assert {$misses2 == $misses} + # Test the the fragmentation is lower and that the defragger + # stopped working + set frag [s mem_fragmentation_ratio] + assert {$frag < 1.55} + set misses [s active_defrag_misses] + after 500 + set misses2 [s active_defrag_misses] + assert {$misses2 == $misses} + } } } } |