mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
Tests for aof-load-truncated = yes.
This commit is contained in:
parent
9f40c25a08
commit
b892ea70ae
@ -23,6 +23,32 @@ proc start_server_aof {overrides code} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tags {"aof"} {
|
tags {"aof"} {
|
||||||
|
## Server can start when aof-load-truncated is set to yes and AOF
|
||||||
|
## is truncated, with an incomplete MULTI block.
|
||||||
|
create_aof {
|
||||||
|
append_to_aof [formatCommand set foo hello]
|
||||||
|
append_to_aof [formatCommand multi]
|
||||||
|
append_to_aof [formatCommand set bar world]
|
||||||
|
}
|
||||||
|
|
||||||
|
start_server_aof [list dir $server_path aof-load-truncated yes] {
|
||||||
|
test "Unfinished MULTI: Server should start if load-truncated is yes" {
|
||||||
|
assert_equal 1 [is_alive $srv]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## Should also start with truncated AOF without incomplete MULTI block.
|
||||||
|
create_aof {
|
||||||
|
append_to_aof [formatCommand set foo hello]
|
||||||
|
append_to_aof [string range [formatCommand set bar world] 0 end-1]
|
||||||
|
}
|
||||||
|
|
||||||
|
start_server_aof [list dir $server_path aof-load-truncated yes] {
|
||||||
|
test "Short read: Server should start if load-truncated is yes" {
|
||||||
|
assert_equal 1 [is_alive $srv]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
## 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]
|
||||||
@ -30,7 +56,7 @@ tags {"aof"} {
|
|||||||
append_to_aof [formatCommand set foo hello]
|
append_to_aof [formatCommand set foo hello]
|
||||||
}
|
}
|
||||||
|
|
||||||
start_server_aof [list dir $server_path aof-load-truncated no] {
|
start_server_aof [list dir $server_path aof-load-truncated yes] {
|
||||||
test "Bad format: Server should have logged an error" {
|
test "Bad format: Server should have logged an error" {
|
||||||
set pattern "*Bad file format reading the append only file*"
|
set pattern "*Bad file format reading the append only file*"
|
||||||
set retry 10
|
set retry 10
|
||||||
|
Loading…
Reference in New Issue
Block a user