Skip to content

Commit

Permalink
Fix unexpected resize causing test failure (#12960)
Browse files Browse the repository at this point in the history
Before #12850, we will only try to shrink the dict in serverCron,
which we can control by using a child process, but now every time
we delete a key, the shrink check will be called.

In these test (added in #12802), we meant to disable the resizing,
but druing the delete, the dict will meet the force shrink, like
2 / 128 = 0.015 < 0.2, the delete will trigger a force resize and
will cause the test to fail.

In this commit, we try to keep the load factor at 3 / 128 = 0.023,
that is, do not meet the force shrink.
  • Loading branch information
enjoy-binbin committed Jan 18, 2024
1 parent 14b1edf commit 29e6245
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/other.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ start_cluster 1 0 {tags {"other external:skip cluster slow"}} {
r config set rdb-key-save-delay 10000000
r bgsave

# delete data to have lot's (99%) of empty buckets
for {set j 1} {$j <= 127} {incr j} {
# delete data to have lot's (98%) of empty buckets
for {set j 1} {$j <= 125} {incr j} {
r del "{foo}$j"
}
assert_match "*table size: 128*" [r debug HTSTATS 0]
Expand Down Expand Up @@ -470,7 +470,7 @@ start_cluster 1 0 {tags {"other external:skip cluster slow"}} {
r config set rdb-key-save-delay 10000000
r bgsave

for {set j 1} {$j <= 127} {incr j} {
for {set j 1} {$j <= 125} {incr j} {
r del "{alice}$j"
}

Expand Down

0 comments on commit 29e6245

Please sign in to comment.