Skip to content

Commit

Permalink
fix five Data structure tcl bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxianrong committed Mar 18, 2024
1 parent cacd576 commit 1de741e
Show file tree
Hide file tree
Showing 14 changed files with 1,381 additions and 318 deletions.
12 changes: 9 additions & 3 deletions tests/assets/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ thread-pool-size : 12
slow-cmd-thread-pool-size : 4

# Slow cmd list e.g. hgetall, mset
# slow-cmd-list :
slow-cmd-list :

# The number of sync-thread for data replication from master, those are the threads work on slave nodes
# and are used to execute commands sent from master node when replicating.
Expand Down Expand Up @@ -79,7 +79,7 @@ requirepass :
# [NOTICE] The value of this parameter must match the "requirepass" setting on the master.
masterauth :

# The [password of user], which is empty by default.(Deprecated)
# The [password of user], which is empty by default.
# [NOTICE] If this user password is the same as admin password (including both being empty),
# the value of this parameter will be ignored and all users are considered as administrators,
# in this scenario, users are not subject to the restrictions imposed by the userblacklist.
Expand All @@ -91,7 +91,7 @@ masterauth :
# [Advice] It's recommended to add high-risk commands to this list.
# [Format] Commands should be separated by ",". For example: FLUSHALL, SHUTDOWN, KEYS, CONFIG
# By default, this list is empty.
userblacklist :
# userblacklist :

# Running Mode of Pika, The current version only supports running in "classic mode".
# If set to 'classic', Pika will create multiple DBs whose number is the value of configure item "databases".
Expand Down Expand Up @@ -341,6 +341,12 @@ max-bytes-for-level-multiplier : 10
# slotmigrate [yes | no]
slotmigrate : no

# slotmigrate thread num
slotmigrate-thread-num : 8

# thread-migrate-keys-num 1/8 of the write_buffer_size_
thread-migrate-keys-num : 64

# BlockBasedTable block_size, default 4k
# block-size: 4096

Expand Down
4 changes: 3 additions & 1 deletion tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,22 @@ set ::all_tests {
unit/scan
unit/multi
unit/quit
unit/type/list
unit/pubsub
unit/slowlog
unit/maxmemory
unit/bitops
unit/hyperloglog
unit/type
unit/acl
unit/type/geo
unit/type/list
unit/type/list-2
unit/type/list-3
unit/type/set
unit/type/zset
unit/type/string
unit/type/hash
unit/type/stream
# unit/expire
# unit/protocol
# unit/other
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/hyperloglog.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ start_server {tags {"hll"}} {
set res
} {5 10}

# This parameter is not available in Pika
# test {HyperLogLogs are promote from sparse to dense} {
# r del hll
# r config set hll-sparse-max-bytes 3000
Expand All @@ -59,6 +60,7 @@ start_server {tags {"hll"}} {
# }
# }

# Pika does not support the pfdebug command
# test {HyperLogLog sparse encoding stress test} {
# for {set x 0} {$x < 1000} {incr x} {
# r del hll1 hll2
Expand All @@ -74,7 +76,7 @@ start_server {tags {"hll"}} {
# r pfadd hll2 {*}$elements
# assert {[r pfdebug encoding hll1] eq {sparse}}
# assert {[r pfdebug encoding hll2] eq {dense}}
# Cardinality estimated should match exactly.
# # Cardinality estimated should match exactly.
# assert {[r pfcount hll1] eq [r pfcount hll2]}
# }
# }
Expand Down Expand Up @@ -224,13 +226,14 @@ start_server {tags {"hll"}} {
# }
# }

# Pika does not support the pfdebug command
# test {PFDEBUG GETREG returns the HyperLogLog raw registers} {
# r del hll
# r pfadd hll 1 2 3
# llength [r pfdebug getreg hll]
# } {16384}


# Pika does not support the pfdebug command
# test {PFDEBUG GETREG returns the HyperLogLog raw registers} {
# r del hll
# r pfadd hll 1 2 3
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/maxmemory.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ start_server {tags {"maxmemory"}} {
# The current maxmemory command does not support config set and policy.
# For a complete list of commands, refer to the wiki: https://github.com/OpenAtomFoundation/pika/wiki/pika-%E5%B7%AE%E5%BC%82%E5%8C%96%E5%91%BD%E4%BB%A4

# This parameter is not available in Pika
# test "Without maxmemory small integers are shared" {
# r config set maxmemory 0
# r set a 1
# assert {[r object refcount a] > 1}
# }

# This parameter is not available in Pika
# 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}
# }

# This parameter is not available in Pika
# test "With maxmemory and LRU policy integers are not shared" {
# r config set maxmemory 1073741824
# r config set maxmemory-policy allkeys-lru
Expand All @@ -31,6 +34,7 @@ start_server {tags {"maxmemory"}} {
# r config set maxmemory 0
# }

# This parameter is not available in Pika
# foreach policy {
# allkeys-random allkeys-lru volatile-lru volatile-random volatile-ttl
# } {
Expand Down Expand Up @@ -63,6 +67,7 @@ start_server {tags {"maxmemory"}} {
# }
# }

# This parameter is not available in Pika
# foreach policy {
# allkeys-random allkeys-lru volatile-lru volatile-random volatile-ttl
# } {
Expand Down Expand Up @@ -105,6 +110,7 @@ start_server {tags {"maxmemory"}} {
# }
# }

# This parameter is not available in Pika
# foreach policy {
# volatile-lru volatile-random volatile-ttl
# } {
Expand Down
Loading

0 comments on commit 1de741e

Please sign in to comment.