Repository navigation
v2.25.4
Patch release, test suite only: no library code changed. The unit tests no longer leave clients running into the tests after them (#183).
Nothing changes for applications. Contributors get a quieter, more deterministic unit suite and a convention for new tests: register what a test starts with $this->own(...) and release it in tearDown() (see AGENTS.md).
Testing & CI
-
Tests own and close what they start (#183). Some unit tests ended with their client still Open or reconnecting, or with an operation still waiting. That client's heartbeat, its reconnect attempts and its operations' 1 ms loops then kept running through the rest of the suite:
- with the defaults, ten reconnect attempts over about 43 s
- each attempt a burst of up to 500 handshake polls on a test double that answers at once
That took CPU from unrelated tests and flaked a test that counted process-wide event-loop registrations.
-
A test-resource scope now owns what a test starts:
tests/Support/TestResourceScope.php, through theOwnsTestResourcestrait.- Every client and connection is registered as it is constructed.
- So are background operations with what ends each, fixture gates, and the test's loop callbacks.
-
Its shutdown runs under one deadline. It stops new work, closes everything at once, and releases fixture gates only once each close intent has run. It joins every close and operation. It fails the test, naming the resource, when anything is still running.
-
All 97 unit classes that construct a client or connection use it.
-
Whole-loop cancellation is gone. The seven classes that cancelled every event-loop callback around each test, which hid the clients they left Open, now close their clients. They cancel only the heartbeat watchdogs their own tests armed.
Quality gates
- PHPStan level 8, full repository.
- 3363 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 seeds
1791624469and20261011. 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.54% (90% floor enforced in CI). It skipped 4899 of the 8771 mutants it generated as too slow, so the score does not include them.
TestResourceScopeTest: 15 new cases covering the scope itself.ServiceTestalone used to leave 61 referenced heartbeat timers on the event loop at the end of its run; it now leaves none.
The full record is in the CHANGELOG.