Skip to content

Commit 029e92b

Browse files
KyleAMathewsclaude
andauthored
Fix CI flake (#3703)
The SQLite-backed metadata storage (cb9f571) introduces initialization overhead that can cause a race condition in tests that check health status immediately after seeing "Starting replication" log. The shape_log_collector_ready condition is set asynchronously in ShapeCache's handle_continue(:wait_for_restore), which now takes longer due to SQLite operations. This causes the health check to return "starting" instead of "active" if checked too quickly. Fix by using the wait-for macro to poll for active status, allowing up to 10 seconds for shape initialization to complete. Co-authored-by: Claude <noreply@anthropic.com>
1 parent d969d16 commit 029e92b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

integration-tests/tests/rolling-deploy.lux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
??[info] Starting replication from postgres
121121

122122
[shell orchestator]
123-
!curl -X GET http://localhost:3001/v1/health?database_id=integration_test_tenant
124-
??{"status":"active"}
123+
# Use wait-for to poll for active status since shape initialization may still be in progress
124+
[invoke wait-for "curl -X GET http://localhost:3001/v1/health?database_id=integration_test_tenant" "\{\"status\":\"active\"\}" 10 $PS1]
125125

126126
# Should see post handover update
127127
[shell client]

integration-tests/tests/startup-delayed-by-pending-transaction.lux

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107

108108
# The 2nd Electric is now healthy and active
109109
[shell client]
110-
!curl -X GET http://localhost:3001/v1/health?database_id=integration_test_tenant
111-
??{"status":"active"}
110+
# Use wait-for to poll for active status since shape initialization may still be in progress
111+
[invoke wait-for "curl -X GET http://localhost:3001/v1/health?database_id=integration_test_tenant" "\{\"status\":\"active\"\}" 10 $PS1]
112112

113113
[cleanup]
114114
[invoke teardown]

0 commit comments

Comments
 (0)