test: add 57 TCP client robustness tests#538
Conversation
Cover read buffer edge cases, broadcast filtering robustness, request ID extraction and generation, TCPReloadResult/ReloadResult protocol parsing, HelloOk/StatusInfo decoding variants, error classification, error message extraction, server-unavailable scenarios, EngineReloadSingleFlight coalescing, and result type coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code Review — PR #538: test: add 57 TCP client robustness tests
OverviewSolid test coverage for the Issues🔴
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c73bdf1624
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| XCTAssertTrue(results.0.isSuccess) | ||
| XCTAssertTrue(results.1.isSuccess) | ||
| let execCount = await counter.get() | ||
| XCTAssertLessThanOrEqual(execCount, 2, "Concurrent requests should coalesce (1) or both run (2)") |
There was a problem hiding this comment.
Assert coalescing rather than permitting both runs
testSingleFlight_CoalescesConcurrentRequests currently passes even when coalescing is broken, because it accepts execCount == 2 and does not force overlap between the two calls. If EngineReloadSingleFlight.run starts executing each concurrent request independently, this test still succeeds, so a regression in the single-flight guarantee can slip through. Tighten this to require one execution (with a gate/barrier to ensure true concurrency) so the test actually validates the behavior named in the test.
Useful? React with 👍 / 👎.
Summary
Closes #530
Test plan