Fix memory test failures with multithreading enabled

Former-commit-id: 58035404227a9ef1c3bd92623a333c915d50eab6
This commit is contained in:
John Sully 2020-05-30 00:06:15 -04:00
parent 5316f656d9
commit bbff81e891
2 changed files with 7 additions and 3 deletions

View File

@ -144,7 +144,11 @@ start_server {tags {"maxmemory"}} {
} }
proc test_slave_buffers {test_name cmd_count payload_len limit_memory pipeline} { proc test_slave_buffers {test_name cmd_count payload_len limit_memory pipeline} {
start_server {tags {"maxmemory"}} { # This is a single thread only test because there is a race in getMaxMemoryState
# between zmalloc_used_memory and getting the client outbut buffer memory usage.
# The cure would be worse than the disease, we do not want lock every replica
# simultaneously just to get more accurate memory usage.
start_server {tags {"maxmemory"} overrides { server-threads 1 }} {
start_server {} { start_server {} {
set slave_pid [s process_id] set slave_pid [s process_id]
test "$test_name" { test "$test_name" {

View File

@ -37,7 +37,7 @@ start_server {tags {"memefficiency"}} {
} }
run_solo {defrag} { run_solo {defrag} {
start_server {tags {"defrag"}} { start_server {tags {"defrag"} overrides {server-threads 1} } {
if {[string match {*jemalloc*} [s mem_allocator]]} { if {[string match {*jemalloc*} [s mem_allocator]]} {
test "Active defrag" { test "Active defrag" {
r config set save "" ;# prevent bgsave from interfereing with save below r config set save "" ;# prevent bgsave from interfereing with save below
@ -351,7 +351,7 @@ start_server {tags {"defrag"}} {
# if the current slab is lower in utilization the defragger would have ended up in stagnation, # if the current slab is lower in utilization the defragger would have ended up in stagnation,
# keept running and not move any allocation. # keept running and not move any allocation.
# this test is more consistent on a fresh server with no history # this test is more consistent on a fresh server with no history
start_server {tags {"defrag"}} { start_server {tags {"defrag"} overrides {server-threads 1}} {
r flushdb r flushdb
r config resetstat r config resetstat
r config set save "" ;# prevent bgsave from interfereing with save below r config set save "" ;# prevent bgsave from interfereing with save below