Skip to content

Commit

Permalink
Defrag: fix test false positive.
Browse files Browse the repository at this point in the history
Apparently 1.4 is too low compared to what you get in certain setups
(including mine). I raised it to 1.55 that hopefully is still enough to
test that the fragmentation went down from 1.7 but without incurring in
issues, however the test setup may be still fragile so certain times this
may lead to false positives again, it's hard to test for these things
in a determinsitic way.

Related to redis#3786.
  • Loading branch information
antirez committed Apr 22, 2017
1 parent 0fb5c4e commit a173908
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/memefficiency.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ start_server {tags {"memefficiency"}} {

start_server {tags {"defrag"}} {
if {[string match {*jemalloc*} [s mem_allocator]]} {
test "Actove defrag" {
test "Active defrag" {
r config set activedefrag no
r config set active-defrag-threshold-lower 5
r config set active-defrag-ignore-bytes 2mb
Expand Down Expand Up @@ -70,9 +70,10 @@ start_server {tags {"defrag"}} {
# 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
# Test the the fragmentation is lower and that the defragger
# stopped working
set frag [s mem_fragmentation_ratio]
assert {$frag < 1.4}
assert {$frag < 1.55}
set misses [s active_defrag_misses]
after 500
set misses2 [s active_defrag_misses]
Expand Down

0 comments on commit a173908

Please sign in to comment.