Repository navigation
test(server): wait for SSE notices with a hang guard, not a reconnect deadline - #1456
Merged
Merged
Conversation
…eadline The listener reconnect test bounded each change notice at 3 seconds. A reset listener waits 1 second and then opens new database connections before it resyncs, which can take longer than the remaining 2 seconds when PostgreSQL starts backends slowly, as on Windows runners. Each wait is now a 30-second hang guard; the expected notices are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Windows scheduler-recovery job fails now and then in
given_terminated_postgres_listeners_when_reconnecting_then_http_survives_and_observers_refetchwithbounded SSE delivery or shutdown: Elapsed. Each failure costs a merge-queue cycle on pull requests that don't touch this code.The test gave every change notice 3 seconds. When a LISTEN connection is reset, the relay waits 1 second and then opens new database connections before it sends the resync, so the test passed only if PostgreSQL started those backends within the remaining 2 seconds. On Windows a reset surfaces as WSAECONNRESET, which sqlx does not reconnect by itself, so both reconnects in the test take this path. PostgreSQL on Windows also starts a new process for each backend, which is slow on a loaded runner.
Changes
DuckShop: test-only change to a server test helper; no project shape, value or lifecycle is involved.
Verification
cargo test -p sqlbuild-orchestration -- test_changespasses on SQLite and PostgreSQL.make check-cion the final head.