mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
Test: small integer sharing depends on maxmemory policy.
This commit is contained in:
parent
6b9b958e00
commit
420584a46d
@ -1,4 +1,28 @@
|
||||
start_server {tags {"maxmemory"}} {
|
||||
test "Without maxmemory small integers are shared" {
|
||||
r config set maxmemory 0
|
||||
r set a 1
|
||||
assert {[r object refcount a] > 1}
|
||||
}
|
||||
|
||||
test "With maxmemory and non-LRU policy integers are still shared" {
|
||||
r config set maxmemory 1073741824
|
||||
r config set maxmemory-policy allkeys-random
|
||||
r set a 1
|
||||
assert {[r object refcount a] > 1}
|
||||
}
|
||||
|
||||
test "With maxmemory and LRU policy integers are not shared" {
|
||||
r config set maxmemory 1073741824
|
||||
r config set maxmemory-policy allkeys-lru
|
||||
r set a 1
|
||||
r config set maxmemory-policy volatile-lru
|
||||
r set b 1
|
||||
assert {[r object refcount a] == 1}
|
||||
assert {[r object refcount b] == 1}
|
||||
r config set maxmemory 0
|
||||
}
|
||||
|
||||
foreach policy {
|
||||
allkeys-random allkeys-lru volatile-lru volatile-random volatile-ttl
|
||||
} {
|
||||
|
Loading…
x
Reference in New Issue
Block a user