Skip to content

test(server): wait for SSE notices with a hang guard, not a reconnect deadline - #1456

Merged
kvlonge merged 1 commit into
mainfrom
fix/sse-listener-reconnect-wait
Nov 13, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/sse-listener-reconnect-wait

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Why

The Windows scheduler-recovery job fails now and then in given_terminated_postgres_listeners_when_reconnecting_then_http_survives_and_observers_refetch with bounded 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

  • The SSE test helper waits up to 30 seconds for each notice instead of 3. This is a hang guard; the test still requires the same notices in the same order.

DuckShop: test-only change to a server test helper; no project shape, value or lifecycle is involved.

Verification

  • With a temporary 2.5 second delay on the test proxy's connections after the reset, the test failed at 3 seconds with the CI message. It passes at 30 seconds, and the reconnect took 6 seconds.
  • Negative control: with the relay's resync after re-listening removed, the test still fails.
  • On Linux the reconnect takes about 1.06 seconds, even with 64 busy processes on 8 cores.
  • cargo test -p sqlbuild-orchestration -- test_changes passes on SQLite and PostgreSQL.
  • make check-ci on the final head.

…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.
@kvlonge kvlonge added the full-verify Run the full Verify matrix on this pull request label Nov 13, 2026
@kvlonge
kvlonge enabled auto-merge November 13, 2026 18:38
@kvlonge
kvlonge added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit ef0d014 Nov 13, 2026
52 of 73 checks passed
@kvlonge
kvlonge deleted the fix/sse-listener-reconnect-wait branch November 13, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-verify Run the full Verify matrix on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant