Skip to content

Commit

Permalink
test: mock debug populate (#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
machinly authored Jul 9, 2023
1 parent bfb8a75 commit ff965a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
7 changes: 7 additions & 0 deletions tests/support/util.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,10 @@ proc start_write_load {host port seconds} {
proc stop_write_load {handle} {
catch {exec /bin/kill -9 $handle}
}

# Mock debug populate
proc populate {size} {
for {set counter 0} {$counter < $size} {incr counter} {
r set "key:$counter" "key:$counter"
}
}
11 changes: 6 additions & 5 deletions tests/unit/scan.tcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
start_server {tags {"scan"}} {
test "SCAN basic" {
r flushdb
r debug populate 1000
populate 1000
#populate 1000

set cur 0
set keys {}
Expand All @@ -19,7 +20,7 @@ start_server {tags {"scan"}} {

test "SCAN COUNT" {
r flushdb
r debug populate 1000
populate 1000

set cur 0
set keys {}
Expand All @@ -37,7 +38,7 @@ start_server {tags {"scan"}} {

test "SCAN MATCH" {
r flushdb
r debug populate 1000
populate 1000

set cur 0
set keys {}
Expand All @@ -56,7 +57,7 @@ start_server {tags {"scan"}} {
test "SCAN TYPE" {
r flushdb
# populate only creates strings
r debug populate 1000
populate 1000

# Check non-strings are excluded
set cur 0
Expand Down Expand Up @@ -214,7 +215,7 @@ start_server {tags {"scan"}} {

test "SCAN guarantees check under write load" {
r flushdb
r debug populate 100
populate 100

# We start scanning here, so keys from 0 to 99 should all be
# reported at the end of the iteration.
Expand Down

0 comments on commit ff965a7

Please sign in to comment.