Skip to content

test: Fix flaky SubscriptionSourceTests on macOS CI - #3280

Merged
mathbunnyru merged 1 commit into
XRPLF:developfrom
mathbunnyru:skip_ssl_attempt
Oct 19, 2026
Merged

mathbunnyru merged 1 commit into
XRPLF:developfrom
mathbunnyru:skip_ssl_attempt

Conversation

@mathbunnyru

Copy link
Copy Markdown
Collaborator

Fixes flaky SubscriptionSourceTests on macOS CI, seen as ReadError_Reconnect failures and a segfault in GotResultWithValidatedLedgersWrongValue_Reconnect.

  • The serverConnection() test helper assumed the server always gets exactly one failed SSL attempt, then the plain connection.
  • With the fixture's 5 ms connection timeout, a loaded runner can time out the SSL attempt before it reaches the server. The helper then took the plain connection as the "failed" one and waited for another. That either hung until the 30 s timeout or picked up the next reconnect's SSL attempt ("Read error: bad method"). The helper then read from the failed connection, which caused the segfault.
  • Reproduced locally by running at background priority (taskpolicy -b) with all cores busy, and with a temporary patch that drops the SSL attempt.
  • Added TestWsServer::acceptConnectionSkippingSslAttempt(). It skips at most one failed connection, so the SSL attempt may or may not arrive, and returns errors instead of hiding them.
  • SubscriptionSourceTests and ForwardingSourceTests, which used the same pattern, now use the helper. The SSL-then-plain fallback is still covered by WsConnectionTests.TrySslUsePlain.
  • With the SSL attempt dropped half the time, the old helper failed on the first iteration and the new one passed 200 of 200.

@mathbunnyru
mathbunnyru requested a review from godexsoft October 19, 2026 20:33
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@godexsoft godexsoft left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange workaround but makes sense i guess.

@mathbunnyru
mathbunnyru merged commit 445148c into XRPLF:develop Oct 19, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants