1
0
mirror of https://github.com/fluencelabs/redis synced 2025-07-20 02:51:55 +00:00
Files
deps
src
tests
assets
cluster
helpers
integration
aof-race.tcl
aof.tcl
convert-zipmap-hash-on-load.tcl
logging.tcl
psync2-reg.tcl
psync2.tcl
rdb.tcl
redis-cli.tcl
replication-2.tcl
replication-3.tcl
replication-4.tcl
replication-psync.tcl
replication.tcl
sentinel
support
tmp
unit
instances.tcl
test_helper.tcl
utils
.gitignore
00-RELEASENOTES
BUGS
CONTRIBUTING
COPYING
INSTALL
MANIFESTO
Makefile
README.md
redis.conf
runtest
runtest-cluster
runtest-sentinel
sentinel.conf
redis/tests/integration/aof-race.tcl

36 lines
1.2 KiB
Tcl
Raw Normal View History

set defaults { appendonly {yes} appendfilename {appendonly.aof} }
set server_path [tmpdir server.aof]
set aof_path "$server_path/appendonly.aof"
proc start_server_aof {overrides code} {
upvar defaults defaults srv srv server_path server_path
set config [concat $defaults $overrides]
start_server [list overrides $config] $code
}
tags {"aof"} {
# Specific test for a regression where internal buffers were not properly
# cleaned after a child responsible for an AOF rewrite exited. This buffer
# was subsequently appended to the new AOF, resulting in duplicate commands.
start_server_aof [list dir $server_path] {
set client [redis [srv host] [srv port]]
set bench [open "|src/redis-benchmark -q -p [srv port] -c 20 -n 20000 incr foo" "r+"]
after 100
# Benchmark should be running by now: start background rewrite
$client bgrewriteaof
# Read until benchmark pipe reaches EOF
while {[string length [read $bench]] > 0} {}
# Check contents of foo
assert_equal 20000 [$client get foo]
}
# Restart server to replay AOF
start_server_aof [list dir $server_path] {
set client [redis [srv host] [srv port]]
assert_equal 20000 [$client get foo]
}
}