Repository navigation
v2.25.5
Patch release, test suite only: no library code changed. The scripted reconnect server used by the unit tests now keeps the order of writes, as a socket does (#192).
Nothing changes for applications. Contributors get unit coverage of backpressure and PING fences that matches what a real socket can do, and a clear way to hold an operation inside a write without holding the writes after it (see AGENTS.md).
Testing & CI
-
Writes reach the scripted server in the order they were made (#192).
- The defect:
tests/Support/ReconnectingTransport.phplet a write made during a stall reach the server before the stalled one. The connection matches PONGs to PINGs by order, so a heartbeat PING overtaking a held-up SUB + PING had its PONG taken for the held-up one's. That confirmed a guarded inbox whose SUB the server had never received, an interleaving no socket produces. - Now: each write waits until the one before it on its session has been accepted. A stalled write holds the later ones, and they fail when their session ends. A new session's writes never wait for an old one's.
- The defect:
-
A writer can be held after its bytes are accepted, without holding any other write:
holdCompletionOfNextWriteContaining()on the scripted server, andtests/Support/CompletionHoldingTransport.phparound any other transport. This is a delay after acceptance, as opposed to backpressure. -
Three tests that relied on a write overtaking a stalled one are restaged, with their assertions kept:
- the heartbeat-shape inbox rejection test (#175), now with PINGs answered over a server that rejects the SUB in wire order
- the mux wait test (#180)
- the drain hand-over order test (#207)
Each still fails when the bug it guards against is put back.
-
New
ReconnectingTransportWriteOrderTest(15 cases) covers the write order, sessions ending and being replaced, and the heartbeat with PINGs answered never confirming an inbox whose SUB is still held.
Quality gates
- PHPStan level 8, full repository.
- 3378 unit tests (with data sets), run in CI on PHP 8.2 to 8.5 under Xdebug. Locally they pass in default order and in random order with seed
192192. Also 157 live integration tests and 49 Behat scenarios; all runnable examples pass. - Coverage unchanged at 99.03%, since no library line changed.
- Infection covered MSI 92.48% (90% floor enforced in CI). It skipped 4753 of the 8771 mutants it generated as too slow, so the score does not include them.
ReconnectingTransportWriteOrderTest: 15 new cases. With the write order taken out of the test double, 11 of them fail; the other 4 are guards.- The restaged tests still catch the bugs they guard against:
- with the guarded inbox rejection removed, both fetch cases fail
- with the mux wake-up cancelling nothing, all four request cases fail
- with the drain hand-over reversed, the drain case fails
The full record is in the CHANGELOG.