test(backups): cover a restore that starts on an idle ClickHouse sidecar

The strategy suite only exercised restore against a busy sidecar, so a
gate that wrongly blocked restore on an idle one would have stayed
green.

Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
This commit is contained in:
Alexey Artamonov committed 2026-11-04 19:30:54 +03:00
1 parent a25db5aeb6
commit 3a10f956cc
1 file changed
+8 -1
+8 -1
View File
@@ -117,10 +117,17 @@ run_script() {
render_script "$tmp/s.sh" backup myapp
run_script "$tmp"
grep -q '^POST .*/backup/create_remote?name=clickhouse-myapp-' "$tmp/state/requests"
# All three busy answers were consumed before the operation was started.
[ "$(cat "$tmp/state/busy")" = 0 ]
}
@test "restore on an idle sidecar starts restore_remote of the listed archive" {
tmp=$(mktemp -d)
make_stubs "$tmp/bin" "$tmp/state"
render_script "$tmp/s.sh" restore myapp
run_script "$tmp"
grep -q '^POST .*/backup/restore_remote/clickhouse-myapp-20260101T000000Z$' "$tmp/state/requests"
}
@test "backup fails without starting create_remote when the sidecar stays busy" {
tmp=$(mktemp -d)
make_stubs "$tmp/bin" "$tmp/state"