Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
3aa4b009
Commit
3aa4b009
authored
Aug 17, 2011
by
Pieter Noordhuis
Committed by
antirez
Sep 16, 2011
Browse files
Failing test related to AOF rewrite buffers
parent
bdbf3acf
Changes
2
Show whitespace changes
Inline
Side-by-side
tests/integration/aof-race.tcl
0 → 100644
View file @
3aa4b009
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
]
}
}
tests/test_helper.tcl
View file @
3aa4b009
...
@@ -29,6 +29,7 @@ set ::all_tests {
...
@@ -29,6 +29,7 @@ set ::all_tests {
integration/replication-2
integration/replication-2
integration/replication-3
integration/replication-3
integration/aof
integration/aof
integration/aof-race
unit/pubsub
unit/pubsub
unit/slowlog
unit/slowlog
unit/scripting
unit/scripting
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment