"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/integration/aof.tcl" between
redis-6.0.7.tar.gz and redis-6.0.8.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

aof.tcl  (redis-6.0.7):aof.tcl  (redis-6.0.8)
skipping to change at line 55 skipping to change at line 55
append_to_aof [formatCommand incr foo] append_to_aof [formatCommand incr foo]
append_to_aof [formatCommand incr foo] append_to_aof [formatCommand incr foo]
append_to_aof [string range [formatCommand incr foo] 0 end-1] append_to_aof [string range [formatCommand incr foo] 0 end-1]
} }
start_server_aof [list dir $server_path aof-load-truncated yes] { start_server_aof [list dir $server_path aof-load-truncated yes] {
test "Short read: Server should start if load-truncated is yes" { test "Short read: Server should start if load-truncated is yes" {
assert_equal 1 [is_alive $srv] assert_equal 1 [is_alive $srv]
} }
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls]
wait_for_condition 50 100 {
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
test "Truncated AOF loaded: we expect foo to be equal to 5" { test "Truncated AOF loaded: we expect foo to be equal to 5" {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls
]
wait_done_loading $client
assert {[$client get foo] eq "5"} assert {[$client get foo] eq "5"}
} }
test "Append a new command after loading an incomplete AOF" { test "Append a new command after loading an incomplete AOF" {
$client incr foo $client incr foo
} }
} }
# Now the AOF file is expected to be correct # Now the AOF file is expected to be correct
start_server_aof [list dir $server_path aof-load-truncated yes] { start_server_aof [list dir $server_path aof-load-truncated yes] {
test "Short read + command: Server should start" { test "Short read + command: Server should start" {
assert_equal 1 [is_alive $srv] assert_equal 1 [is_alive $srv]
} }
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls]
wait_for_condition 50 100 {
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
test "Truncated AOF loaded: we expect foo to be equal to 6 now" { test "Truncated AOF loaded: we expect foo to be equal to 6 now" {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls
]
wait_done_loading $client
assert {[$client get foo] eq "6"} assert {[$client get foo] eq "6"}
} }
} }
## Test that the server exits when the AOF contains a format error ## Test that the server exits when the AOF contains a format error
create_aof { create_aof {
append_to_aof [formatCommand set foo hello] append_to_aof [formatCommand set foo hello]
append_to_aof "!!!" append_to_aof "!!!"
append_to_aof [formatCommand set foo hello] append_to_aof [formatCommand set foo hello]
} }
skipping to change at line 186 skipping to change at line 174
} }
## Test that the server can be started using the truncated AOF ## Test that the server can be started using the truncated AOF
start_server_aof [list dir $server_path aof-load-truncated no] { start_server_aof [list dir $server_path aof-load-truncated no] {
test "Fixed AOF: Server should have been started" { test "Fixed AOF: Server should have been started" {
assert_equal 1 [is_alive $srv] assert_equal 1 [is_alive $srv]
} }
test "Fixed AOF: Keyspace should contain values that were parseable" { test "Fixed AOF: Keyspace should contain values that were parseable" {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ] set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ]
wait_for_condition 50 100 { wait_done_loading $client
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
assert_equal "hello" [$client get foo] assert_equal "hello" [$client get foo]
assert_equal "" [$client get bar] assert_equal "" [$client get bar]
} }
} }
## Test that SPOP (that modifies the client's argc/argv) is correctly free'd ## Test that SPOP (that modifies the client's argc/argv) is correctly free'd
create_aof { create_aof {
append_to_aof [formatCommand sadd set foo] append_to_aof [formatCommand sadd set foo]
append_to_aof [formatCommand sadd set bar] append_to_aof [formatCommand sadd set bar]
append_to_aof [formatCommand spop set] append_to_aof [formatCommand spop set]
} }
start_server_aof [list dir $server_path aof-load-truncated no] { start_server_aof [list dir $server_path aof-load-truncated no] {
test "AOF+SPOP: Server should have been started" { test "AOF+SPOP: Server should have been started" {
assert_equal 1 [is_alive $srv] assert_equal 1 [is_alive $srv]
} }
test "AOF+SPOP: Set should have 1 member" { test "AOF+SPOP: Set should have 1 member" {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ] set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ]
wait_for_condition 50 100 { wait_done_loading $client
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
assert_equal 1 [$client scard set] assert_equal 1 [$client scard set]
} }
} }
## Uses the alsoPropagate() API. ## Uses the alsoPropagate() API.
create_aof { create_aof {
append_to_aof [formatCommand sadd set foo] append_to_aof [formatCommand sadd set foo]
append_to_aof [formatCommand sadd set bar] append_to_aof [formatCommand sadd set bar]
append_to_aof [formatCommand sadd set gah] append_to_aof [formatCommand sadd set gah]
append_to_aof [formatCommand spop set 2] append_to_aof [formatCommand spop set 2]
} }
start_server_aof [list dir $server_path] { start_server_aof [list dir $server_path] {
test "AOF+SPOP: Server should have been started" { test "AOF+SPOP: Server should have been started" {
assert_equal 1 [is_alive $srv] assert_equal 1 [is_alive $srv]
} }
test "AOF+SPOP: Set should have 1 member" { test "AOF+SPOP: Set should have 1 member" {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ] set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ]
wait_for_condition 50 100 { wait_done_loading $client
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
assert_equal 1 [$client scard set] assert_equal 1 [$client scard set]
} }
} }
## Test that EXPIREAT is loaded correctly ## Test that EXPIREAT is loaded correctly
create_aof { create_aof {
append_to_aof [formatCommand rpush list foo] append_to_aof [formatCommand rpush list foo]
append_to_aof [formatCommand expireat list 1000] append_to_aof [formatCommand expireat list 1000]
append_to_aof [formatCommand rpush list bar] append_to_aof [formatCommand rpush list bar]
} }
start_server_aof [list dir $server_path aof-load-truncated no] { start_server_aof [list dir $server_path aof-load-truncated no] {
test "AOF+EXPIRE: Server should have been started" { test "AOF+EXPIRE: Server should have been started" {
assert_equal 1 [is_alive $srv] assert_equal 1 [is_alive $srv]
} }
test "AOF+EXPIRE: List should be empty" { test "AOF+EXPIRE: List should be empty" {
set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ] set client [redis [dict get $srv host] [dict get $srv port] 0 $::tls ]
wait_for_condition 50 100 { wait_done_loading $client
[catch {$client ping} e] == 0
} else {
fail "Loading DB is taking too much time."
}
assert_equal 0 [$client llen list] assert_equal 0 [$client llen list]
} }
} }
start_server {overrides {appendonly {yes} appendfilename {appendonly.aof}}} { start_server {overrides {appendonly {yes} appendfilename {appendonly.aof}}} {
test {Redis should not try to convert DEL into EXPIREAT for EXPIRE -1} { test {Redis should not try to convert DEL into EXPIREAT for EXPIRE -1} {
r set x 10 r set x 10
r expire x -1 r expire x -1
} }
} }
 End of changes. 8 change blocks. 
36 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)