Skip to content

Restore strict expectations in tests converted to Double - #114

Merged
binaryfire merged 71 commits into
0.4from
upstream-sync-2026-11-14-3
Nov 18, 2026
Merged

binaryfire merged 71 commits into
0.4from
upstream-sync-2026-11-14-3

Conversation

@binaryfire

@binaryfire binaryfire commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Double accepts unexpected calls by default and compares object arguments by value. Some tests lost checks when they moved from Mockery. They could pass if a handler received a different instance or if code called an unexpected method.

The tests now use strict doubles unless they deliberately ignore unrelated calls. They check object identity where the same request, job, connection or exception must be passed through. Tests that record arguments do so after a call matches. The suite uses Double's development branch for its fixes to expectation verification.

Several tests now check the result directly. For example, the permission scope tests exercise both integer and UUID keys, and the Reverb test checks that a subscribed socket actually receives the broadcast.

There’s also a fix for idle database connections. If releasing one lease throws, the resolver now attempts to release the remaining leases before propagating the failure. Cancellation takes precedence if cleanup encounters both cancellation and another error.


Summary by cubic

Restores the strictness lost when tests moved from Mockery to Double, so unexpected calls and object substitutions can no longer pass silently.

  • Double is lenient by default and compares object arguments by value; ported tests now use strict() doubles and Argument::same() where instance identity matters.
  • Argument recording and assertions moved out of Double matcher predicates, which Double can evaluate more than once.
  • The suite pins jasonmccreary/double to dev-master for fixes to expectation verification.
  • ConnectionResolver::releaseIdleConnections() releases every idle lease before propagating the first failure, with cancellation taking precedence.
  • Permission scope tests now exercise integer and UUID fixture keys, and the Reverb test verifies the subscribed socket receives the broadcast.
  • Fixture updates model real behavior: Redis release tests use a connected client in atomic mode, the Guzzle body-export test verifies the caller keeps its open resource after a failed read, Sentry telemetry covers the deferred WebSocket handshake and optional OTLP lookup, and the Tinker caster test permits unrelated application reads while requiring the failing property and version lookup.

Written for commit 3dab76a. Summary will update on new commits.

View guided diff Turn on auto-fix

Note

Restore strict expectations in tests converted to Double

  • Converts most test doubles across the suite to strict mode, so unconfigured calls fail the test. Uses Argument::same for identity matching of objects, Argument::capture plus post-call assertions instead of side-effecting matcher callbacks, and expectNotToPerformAssertions() instead of trivial assertTrue(true) placeholders.
  • Updates AGENTS.md testing guidance: prefer strict doubles unless a test intentionally ignores unrelated calls; notes that with() compares objects with == and recommends Argument::same() for exact-instance matching.
  • Changes jasonmccreary/double constraint in composer.json from ^1.1.1 to dev-master.
  • Fixes idle-connection cleanup in ConnectionResolver.php: a throwing releaseIfIdle call no longer aborts the loop; remaining idle values are still released, then the preferred failure (cancellation preferred via Coroutine::preferCancellation) is thrown.
  • Behavioral Change: strict doubles reject any call not explicitly configured, so previously silently ignored interactions (e.g. Process::stop on destructor, isMaria) now require allowances; the ConnectionResolver cleanup fix changes failure propagation when multiple idle releases throw.

Macroscope summarized 3dab76a.

A failed pool release previously left later idle leases in the coroutine context holding their physical sessions. Attempt each release before propagating the first failure, giving a caller cancellation precedence as in terminal connection cleanup.

Exercise the public database manager with two failing leases to check that both are visited and that the correct exception reaches the caller.
The released version can lose expectation failures caught by application code. Use the development branch containing the final-verification fix so forbidden calls still fail their tests.
Distinguish value comparison from the exact-instance matcher so converting a Mockery expectation preserves identity where the test relies on it.
Role assignment dispatches the event as one argument. Match that call so the never expectation directly identifies a forbidden dispatch when the event has no listeners.
QueueManager must supply the application that owns each connection. Match the exact instance when assigning or replacing it so the expectations remain meaningful even when two containers have equal state.
The SDK handler records a command before rejecting it with a queued exception. Check its name after the exception reaches the caller so a different failing operation cannot satisfy the deletion test.
An empty AWS mock handler throws before recording the command. Its last-command value cannot show whether a send was attempted here. Keep the checks for the original preparation failure and the events delivered for each outstanding job.
A predicate can be evaluated again to explain a mismatch. Keep the SQLite state check free of side effects and record the update in the response callback so the operation log reflects accepted calls.
Group the Double verification trait alphabetically with the database, Redis and rate limiter test traits. Describe the unlink fixture in terms of the deletion batches it records.
Preserve the unexpected-call checks of plain Mockery mocks when converting them to Double. Record arguments and call effects only after an expectation matches, since Double can evaluate predicates while considering other expectations or explaining a mismatch.
Use the same default for Hypervel tests and tests imported from upstream. Keep loose behavior where a test deliberately permits unrelated calls.
Configure the test doubles used by model gateways, tool execution and service clients to reject unconfigured calls. Keep each test’s existing return values, ordering and required interactions.
Check the exact user sent to credential validation, password rehashing and token storage. Record remembered logins only when the expected dispatch occurs. Use strict doubles for configured collaborators, retaining the intentionally loose store validator, and verify the actual cached result and no-op guard behavior.
Reject unconfigured collaborator calls in the broadcaster tests. Capture Mercure updates after the publish expectation matches, so diagnostic matcher evaluations cannot change the value inspected by the test.
Check the queued batch chain and its trailing closure, and verify the serialized options passed to the PostgreSQL insert. Require the original job on forwarded dispatches and forbid all instances of faked job classes from reaching the real dispatcher.
Check the event, inverse-relation callback, validation input and SQS cleanup exception that each double actually received. Keep existing type and value assertions, and reject unrelated calls on the configured collaborators.
Read forwarded IP headers in the response callback of each matched Algolia search. Keep the argument matchers free of side effects so evaluating candidate calls cannot add duplicate observations.
Register one finite factory expectation for each test and return its connection proxies in order. This catches extra lookups while preserving the distinct clients used in read, write and retry phases.
Clarify why normalized policy guesses prevent duplicate worker-lifetime instances. Mark the intentional store-wide event behavior next to the ported cache assertion so future upstream updates preserve it.
Require the repository selected by the user provider for both cache fills. In broadcasting, verify the rescued exception by identity and forbid reporting any exception on cancellation.
Make unexpected calls to the Redis collaborators fail, including in the tag rewrite integration test. Let Redis exceptions retain their trace when flushing a missing tag and check that the other tag still holds its value.
Select strict mode on store, lock and command doubles. Require interval error reporting before exercising the cache, while matching restored exceptions by class and message. Remove unconditional assertions where the existing call expectations or failure checks already cover the behavior.
Use strict doubles in the pool fixture and its connection and idle monitor tests. This makes additional calls during checkout, keepalive and release visible to those tests.
Require the scheduled event, application and reported exception to be the original instances. Share the scheduling process fixture so each strict double allows the stop call Symfony makes on destruction.
Require the same command to be unregistered when signal handling finishes. Give the prohibition message a real null output and keep command interactions explicit across the console fixtures.
Reject unconfigured calls to contextual binding and cookie collaborators. Express the timer no-throw case directly through PHPUnit when clearing a nonexistent timer.
Require exception handlers to receive the original failure from lifecycle hooks and coroutine cleanup. Make unexpected interactions with the workers, waiters and signal collaborators fail at the call site.
Declare strict mode for the collaborators exercised by collection creation and transformation. Unexpected calls can then fail even when the transformed return value would still match.
Remove the unconditional assertion. A failure during termination now reaches PHPUnit directly, and the test declares that normal return is the expected outcome.
Reject unexpected interactions during client discovery and launch. Allow the stop call made by the Symfony process destructor while verifying how the database command builds and runs the client.
Let the same scope test run against standard, team and custom permission models. This replaces a passing placeholder and checks inverse scope behavior on UUIDs as well. Verify the teams-disabled migration leaves the team column absent.
Make request and response collaborators strict and check the response carried by request exceptions. Express void capability checks directly when normal return is the result under test.
Require the original cancellation or cleanup exception at the reporting boundary. Verify deferred telemetry forwards the original callbacks, instruments, log record and context.
Check the exact request, user and cache repository when credentials are validated and token state is invalidated. Reject unconfigured calls on the authentication collaborators.
Check both dispatched notification jobs after dispatch and require the original notification and recipient. Exercise fake and real process results through their fluent return values.
Check partial publication order when the exception is reported. Capture the settled result and inspect the worker options supplied by the console command without running assertions inside matchers.
Require the original Beanstalk job and SQS cleanup failure. Forbid resolving the overflow cache on release cancellation, and check Redis bulk script arguments after publication.
Freeze the pruning cutoff so a zero-hour argument has an observable result. Keep the real dispatcher for ordinary retries, and verify selected dispatches and daemon failures explicitly in worker tests.
Use strict collaborators for job dispatch, queue routing, state changes and batches. Verify custom collection restoration and require cancellation to propagate through sync payload serialization.
Configure the cluster mode once on the strict limiter fixture. Keep the real pool context key and check that registering event callbacks leaves an unbound event dispatcher alone.
Check that a subscriber receives messages for its channel and that releasing an unclaimed slot preserves the connection cap on both storage backends. Check which application, payload and shutdown errors are forwarded.
Verify that a route added to a compiled collection is available by name and that Scout’s no-op engines leave the stored model in place. Make the intended collaborator interactions explicit.
Require configured calls in the transport and session tests and match forwarded requests and failures by identity. This catches substitutions that compare equal.
Verify the value returned by the Timebox callback and that Sleep callbacks stay idle outside fake mode. Match the actual queued jobs and reported exceptions.
Record skip callbacks and check them after processing the attributes so missing callbacks fail the tests. Verify the queue payload hook consumed its one-time binding and check the output and exception sent to the console handler.
Match the query and values passed through to the ordinary presence verifier. Count each rejected condition after catching the expected type error and make the no-throw constructor checks explicit.
Verify that composers receive the view being rendered and custom engines receive the registered resolver. Require configured interactions from the view and watcher collaborators.
Bind the handlers under test in an isolated container so service resolution and the exception-reporting fallback run normally. Check cancellation and listener failures by identity and make the expected log calls explicit.
@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. CI tests can change without a code change 🐞 Bug ☼ Reliability
Description
The jasonmccreary/double requirement now tracks the mutable dev-master branch instead of a
versioned release. Because CI installs dependencies from a fresh checkout without a tracked root
lockfile, an upstream branch update can change Double's behavior or break the test suite without any
change to this repository.
Code

composer.json[130]

+        "jasonmccreary/double": "dev-master",
Evidence
The changed requirement selects dev-master; CI runs composer install, and the root lockfile is
intentionally untracked. The test suite imports Double directly, so resolving another branch commit
changes the code used by CI.

composer.json[130-130]
.github/workflows/tests.yml[40-42]
.gitignore[33-36]
tests/Coroutine/ConcurrentTest.php[15-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The untracked root lockfile means CI resolves the mutable `dev-master` branch on each install, so tests can change without a repository change.
## Fix Focus Areas
- composer.json[130-130]
## Recommended Fix
Require a tagged release containing the verification fix, or pin the verified development commit until such a release is available.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Restore strict Double expectations and complete idle connection cleanup

🧪 Tests 🐞 Bug fix ⚙️ Configuration changes 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Restore strict, identity-aware Double expectations across component tests to catch unexpected
 calls and incorrect handoffs.
• Replace vacuous assertions with observable results, including permission scopes and Reverb
 broadcasts.
• Release every idle database lease after failures, prioritizing cancellation when propagating
 cleanup errors.
Diagram

graph TD
  T["Component tests"] --> D["Strict Doubles"] --> M["Verified interactions"]
  T --> R["Result assertions"]
  C["Coroutine context"] --> L["Idle leases"] --> P["Release attempts"] --> E["Preferred failure"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pin a stable Double release
  • ➕ Reproducible dependency selection without tracking a moving development branch
  • ➖ The currently released version can lose expectation failures caught by application code
2. Use a shared strict-double factory
  • ➕ Makes strictness the test-suite default in one place
  • ➖ Adds an abstraction across diverse tests and obscures deliberately lenient doubles

Recommendation: Keep explicit strictness and identity matchers because they make each test's interaction contract visible. The development-branch dependency addresses a verification defect, but replace it with a fixed release or commit once the fix is available.

Files changed (528) +4947 / -5119

Bug fix (1) +11 / -1
ConnectionResolver.phpContinue releasing idle leases after failures +11/-1

Continue releasing idle leases after failures

• Attempts every idle lease release before rethrowing a failure; cancellation takes precedence over an ordinary cleanup error.

src/database/src/ConnectionResolver.php

Tests (524) +4927 / -5113
BroadcastBatchingTest.phpStrengthen broadcast batching double +1/-1

Strengthen broadcast batching double

• Makes the test double reject unexpected interactions.

tests/Ai/BroadcastBatchingTest.php

ConcurrentToolsTest.phpCheck concurrent tool handoffs +13/-13

Check concurrent tool handoffs

• Uses exact-instance matchers for objects passed through concurrent tool execution.

tests/Ai/ConcurrentToolsTest.php

CoroutineIsolationTest.phpStrictly verify coroutine isolation +9/-9

Strictly verify coroutine isolation

• Makes coroutine-isolation doubles reject unconfigured calls.

tests/Ai/CoroutineIsolationTest.php

AgentProviderSelectionTest.phpCheck provider selection arguments +2/-2

Check provider selection arguments

• Tightens Double expectations for selected provider objects.

tests/Ai/Feature/AgentProviderSelectionTest.php

AiManagerTest.phpTighten AI manager expectation +1/-1

Tighten AI manager expectation

• Makes the manager interaction assertion identity-aware.

tests/Ai/Feature/AiManagerTest.php

BroadcastAgentTest.phpCheck broadcast agent handoff +1/-1

Check broadcast agent handoff

• Tightens the expected object argument in broadcast-agent coverage.

tests/Ai/Feature/BroadcastAgentTest.php

EmbeddingsCacheTest.phpVerify embedding cache handoffs +2/-2

Verify embedding cache handoffs

• Uses identity-aware expectations for objects passed to the cache.

tests/Ai/Feature/EmbeddingsCacheTest.php

FilesystemToolsTest.phpVerify filesystem tool arguments +6/-6

Verify filesystem tool arguments

• Uses exact-instance matching in filesystem tool expectations.

tests/Ai/Feature/FilesystemToolsTest.php

CreatesClientTest.phpMake client-creation doubles strict +2/-2

Make client-creation doubles strict

• Rejects unexpected calls to client-creation collaborators.

tests/Ai/Feature/Gateway/Concerns/CreatesClientTest.php

PendingProviderTest.phpCheck pending provider object identity +5/-5

Check pending provider object identity

• Tightens expectations for provider objects passed through requests.

tests/Ai/Feature/PendingProviderTest.php

RememberConversationTest.phpCheck conversation handoffs +7/-7

Check conversation handoffs

• Matches the exact conversation-related objects used by the feature.

tests/Ai/Feature/RememberConversationTest.php

DatabaseConversationStoreTest.phpMake conversation-store doubles strict +22/-22

Make conversation-store doubles strict

• Prevents unconfigured database-store collaborator calls from passing silently.

tests/Ai/Feature/Storage/DatabaseConversationStoreTest.php

StoreFakeTest.phpMake store-fake double strict +1/-1

Make store-fake double strict

• Rejects unexpected calls in store-fake coverage.

tests/Ai/Feature/StoreFakeTest.php

ToolRequestValidationTest.phpVerify tool request identity +2/-2

Verify tool request identity

• Tightens object argument matching during tool request validation.

tests/Ai/Feature/ToolRequestValidationTest.php

McpClientTransportTest.phpVerify MCP transport arguments +2/-2

Verify MCP transport arguments

• Matches exact objects passed to transport collaborators.

tests/Ai/McpClientTransportTest.php

PartitionStoreTest.phpCheck partition-store handoff +1/-1

Check partition-store handoff

• Makes a store interaction identity-aware.

tests/Ai/PartitionStoreTest.php

InvokesToolsTest.phpMake tool-invocation doubles strict +2/-2

Make tool-invocation doubles strict

• Rejects unexpected calls during gateway tool invocation.

tests/Ai/Unit/Gateway/InvokesToolsTest.php

RunContextTest.phpMake run-context doubles strict +2/-2

Make run-context doubles strict

• Rejects unexpected interactions with run-context collaborators.

tests/Ai/Unit/Gateway/RunContextTest.php

TextGenerationLoopTest.phpCheck text-generation handoffs +20/-20

Check text-generation handoffs

• Uses exact-instance matching for objects flowing through generation loops.

tests/Ai/Unit/Gateway/TextGenerationLoopTest.php

AgentToolTest.phpCheck agent-tool arguments +5/-5

Check agent-tool arguments

• Verifies the original object instances passed to agent tools.

tests/Ai/Unit/Tools/AgentToolTest.php

ApiRequestTest.phpTighten API request expectation +1/-1

Tighten API request expectation

• Matches the expected request object by identity.

tests/ApiClient/ApiRequestTest.php

ApiResourceTest.phpMake API resource doubles strict +2/-2

Make API resource doubles strict

• Rejects unconfigured resource collaborator calls.

tests/ApiClient/ApiResourceTest.php

AuthAccessGateTest.phpVerify access-gate arguments +2/-2

Verify access-gate arguments

• Tightens identity-sensitive gate expectations.

tests/Auth/AuthAccessGateTest.php

AuthDatabaseTokenRepositoryTest.phpCheck database token interactions +12/-12

Check database token interactions

• Matches original objects in token-repository collaborator calls.

tests/Auth/AuthDatabaseTokenRepositoryTest.php

AuthDatabaseUserProviderTest.phpCheck database provider interactions +22/-22

Check database provider interactions

• Uses identity-aware matchers for user-provider handoffs.

tests/Auth/AuthDatabaseUserProviderTest.php

AuthEloquentUserProviderCacheTest.phpMake cached-provider doubles strict +56/-56

Make cached-provider doubles strict

• Rejects unexpected calls throughout Eloquent user-provider cache coverage.

tests/Auth/AuthEloquentUserProviderCacheTest.php

AuthEloquentUserProviderTest.phpVerify Eloquent provider handoffs +6/-6

Verify Eloquent provider handoffs

• Matches exact objects in Eloquent user-provider expectations.

tests/Auth/AuthEloquentUserProviderTest.php

AuthGuardTest.phpTighten guard interaction checks +50/-51

Tighten guard interaction checks

• Restores identity-sensitive expectations and aligns assertions with actual guard calls.

tests/Auth/AuthGuardTest.php

AuthManagerTest.phpCheck auth-manager handoffs +54/-54

Check auth-manager handoffs

• Matches exact application and collaborator objects in manager expectations.

tests/Auth/AuthManagerTest.php

AuthPasswordBrokerManagerTest.phpCheck broker-manager arguments +30/-30

Check broker-manager arguments

• Verifies object identity in password-broker manager interactions.

tests/Auth/AuthPasswordBrokerManagerTest.php

AuthPasswordBrokerTest.phpTighten password-broker doubles +37/-37

Tighten password-broker doubles

• Uses strict collaborators and identity-aware expectations for broker flows.

tests/Auth/AuthPasswordBrokerTest.php

AuthPasswordResetServiceProviderTest.phpVerify reset-provider handoffs +4/-4

Verify reset-provider handoffs

• Matches exact instances in password-reset provider calls.

tests/Auth/AuthPasswordResetServiceProviderTest.php

AuthRequestGuardTest.phpCheck request-guard identity +16/-16

Check request-guard identity

• Uses exact-instance matchers for request-guard interactions.

tests/Auth/AuthRequestGuardTest.php

AuthServiceProviderTest.phpCheck auth-provider wiring +31/-31

Check auth-provider wiring

• Tightens identity-sensitive service-provider expectations.

tests/Auth/AuthServiceProviderTest.php

AuthTokenGuardTest.phpCheck token-guard handoffs +33/-33

Check token-guard handoffs

• Matches original objects in token-guard collaborator calls.

tests/Auth/AuthTokenGuardTest.php

AuthenticateMiddlewareTest.phpCheck authentication middleware arguments +5/-5

Check authentication middleware arguments

• Uses identity-aware matching for middleware handoffs.

tests/Auth/AuthenticateMiddlewareTest.php

AuthenticateWithBasicAuthMiddlewareTest.phpMake basic-auth doubles strict +7/-7

Make basic-auth doubles strict

• Rejects unexpected middleware collaborator calls.

tests/Auth/AuthenticateWithBasicAuthMiddlewareTest.php

AuthorizableTest.phpMake authorizable double strict +1/-1

Make authorizable double strict

• Rejects unconfigured authorization interactions.

tests/Auth/AuthorizableTest.php

AuthorizesRequestsTest.phpMake request-authorization double strict +1/-1

Make request-authorization double strict

• Rejects unconfigured authorization calls.

tests/Auth/AuthorizesRequestsTest.php

CacheTokenRepositoryTest.phpMake token-cache doubles strict +29/-29

Make token-cache doubles strict

• Rejects unexpected cache and repository calls in token tests.

tests/Auth/CacheTokenRepositoryTest.php

ClearResetsCommandTest.phpVerify reset-command arguments +6/-6

Verify reset-command arguments

• Tightens object matching for clear-resets command collaborators.

tests/Auth/ClearResetsCommandTest.php

EnsureEmailIsVerifiedTest.phpCheck verification middleware handoffs +4/-4

Check verification middleware handoffs

• Matches exact objects used by email-verification middleware.

tests/Auth/EnsureEmailIsVerifiedTest.php

RedirectIfAuthenticatedMiddlewareTest.phpCheck redirect middleware handoffs +12/-12

Check redirect middleware handoffs

• Verifies identity of arguments passed to middleware collaborators.

tests/Auth/RedirectIfAuthenticatedMiddlewareTest.php

RequirePasswordMiddlewareTest.phpCheck password middleware handoffs +15/-15

Check password middleware handoffs

• Uses exact-instance matchers in password-confirmation middleware tests.

tests/Auth/RequirePasswordMiddlewareTest.php

TimeboxIsolationTest.phpVerify timebox isolation arguments +9/-9

Verify timebox isolation arguments

• Matches original objects across timebox-isolation calls.

tests/Auth/TimeboxIsolationTest.php

UseGuardMiddlewareTest.phpCheck guard middleware arguments +2/-2

Check guard middleware arguments

• Tightens middleware object-identity expectations.

tests/Auth/UseGuardMiddlewareTest.php

VerifiedEventTest.phpMake verified-event double strict +1/-1

Make verified-event double strict

• Rejects unexpected event collaborator calls.

tests/Auth/VerifiedEventTest.php

AblyBroadcasterTest.phpCheck Ably broadcast handoffs +2/-2

Check Ably broadcast handoffs

• Tightens identity-sensitive broadcaster expectations.

tests/Broadcasting/AblyBroadcasterTest.php

BroadcastConnectionReleaseTest.phpStrictly verify broadcast release +5/-5

Strictly verify broadcast release

• Rejects unexpected connection-release interactions.

tests/Broadcasting/BroadcastConnectionReleaseTest.php

BroadcastEventTest.phpVerify broadcast event identity +14/-14

Verify broadcast event identity

• Matches exact event and collaborator objects during broadcasting.

tests/Broadcasting/BroadcastEventTest.php

BroadcastPoolProxyTest.phpMake broadcast-pool doubles strict +3/-3

Make broadcast-pool doubles strict

• Rejects unconfigured proxy and pool interactions.

tests/Broadcasting/BroadcastPoolProxyTest.php

BroadcasterTest.phpVerify broadcaster arguments +9/-9

Verify broadcaster arguments

• Uses identity-aware expectations for broadcaster calls.

tests/Broadcasting/BroadcasterTest.php

InteractsWithBroadcastingTest.phpCheck broadcasting trait handoffs +2/-2

Check broadcasting trait handoffs

• Matches exact objects in broadcasting trait expectations.

tests/Broadcasting/InteractsWithBroadcastingTest.php

LogBroadcasterTest.phpCheck log broadcaster arguments +2/-2

Check log broadcaster arguments

• Tightens identity-sensitive log broadcaster calls.

tests/Broadcasting/LogBroadcasterTest.php

MercureBroadcasterTest.phpSimplify Mercure expectation checks +5/-13

Simplify Mercure expectation checks

• Adjusts broadcaster double expectations and removes redundant matcher-based checks.

tests/Broadcasting/MercureBroadcasterTest.php

PendingBroadcastTest.phpCheck pending broadcast identity +5/-5

Check pending broadcast identity

• Matches exact instances passed through pending broadcasts.

tests/Broadcasting/PendingBroadcastTest.php

PusherBroadcasterTest.phpCheck Pusher broadcast arguments +5/-5

Check Pusher broadcast arguments

• Tightens object identity in Pusher expectations.

tests/Broadcasting/PusherBroadcasterTest.php

RedisBroadcasterTest.phpCheck Redis broadcast handoffs +10/-10

Check Redis broadcast handoffs

• Uses identity-aware matching in Redis broadcaster tests.

tests/Broadcasting/RedisBroadcasterTest.php

BusBatchTest.phpMake batch doubles strict +42/-43

Make batch doubles strict

• Rejects unexpected batch collaborator calls and tightens interaction assertions.

tests/Bus/BusBatchTest.php

BusBatchableTest.phpCheck batchable job identity +4/-4

Check batchable job identity

• Matches exact objects passed through batchable jobs.

tests/Bus/BusBatchableTest.php

BusDebounceLockTest.phpCheck debounce-lock handoffs +3/-3

Check debounce-lock handoffs

• Tightens identity-sensitive lock interactions.

tests/Bus/BusDebounceLockTest.php

BusDispatcherTest.phpVerify bus dispatch identity +11/-11

Verify bus dispatch identity

• Matches original jobs and collaborators during dispatch.

tests/Bus/BusDispatcherTest.php

BusPendingBatchTest.phpVerify pending-batch handoffs +51/-53

Verify pending-batch handoffs

• Tightens exact-instance expectations and removes weak interaction checks.

tests/Bus/BusPendingBatchTest.php

BusPendingDispatchTest.phpCheck pending-dispatch job identity +4/-4

Check pending-dispatch job identity

• Verifies that dispatch receives the original job object.

tests/Bus/BusPendingDispatchTest.php

DispatchLockContextTest.phpCheck dispatch-lock identity +5/-5

Check dispatch-lock identity

• Matches exact lock-context objects in expectations.

tests/Bus/DispatchLockContextTest.php

OutboxOptionsTest.phpTighten outbox-options expectation +1/-1

Tighten outbox-options expectation

• Checks the expected instance rather than value equality.

tests/Bus/OutboxOptionsTest.php

QueueableTest.phpVerify queueable job handoffs +20/-23

Verify queueable job handoffs

• Tightens object-identity expectations and removes checks that no longer provide meaningful coverage.

tests/Bus/QueueableTest.php

CacheDatabaseLockTest.phpCheck database-lock interactions +16/-17

Check database-lock interactions

• Tightens lock collaborator expectations and removes redundant matcher assertions.

tests/Cache/CacheDatabaseLockTest.php

CacheDatabaseStoreTest.phpCheck database cache arguments +19/-19

Check database cache arguments

• Matches exact objects in database cache-store expectations.

tests/Cache/CacheDatabaseStoreTest.php

CacheEventsTest.phpCheck cache event identity +15/-15

Check cache event identity

• Verifies original event objects are dispatched.

tests/Cache/CacheEventsTest.php

CacheFailoverStoreTest.phpVerify cache failover handoffs +41/-41

Verify cache failover handoffs

• Uses identity-aware expectations across failover stores.

tests/Cache/CacheFailoverStoreTest.php

CacheFileStoreTest.phpCheck file-store arguments +3/-3

Check file-store arguments

• Tightens object matching in file-cache tests.

tests/Cache/CacheFileStoreTest.php

CacheManagerTest.phpCheck cache-manager wiring +20/-20

Check cache-manager wiring

• Matches exact collaborator instances supplied by the cache manager.

tests/Cache/CacheManagerTest.php

CacheMemoizedStoreTest.phpMake memoized-store doubles strict +6/-6

Make memoized-store doubles strict

• Rejects unexpected calls in memoized cache coverage.

tests/Cache/CacheMemoizedStoreTest.php

CacheNullStoreTest.phpTighten null-store test double +1/-1

Tighten null-store test double

• Strengthens the null-store interaction contract.

tests/Cache/CacheNullStoreTest.php

CacheRedisLockTest.phpCheck Redis lock arguments +9/-9

Check Redis lock arguments

• Matches exact objects in Redis lock expectations.

tests/Cache/CacheRedisLockTest.php

CacheRedisStoreTest.phpTighten Redis-store expectation +1/-1

Tighten Redis-store expectation

• Makes the expected collaborator handoff identity-aware.

tests/Cache/CacheRedisStoreTest.php

CacheRepositoryEnumTest.phpCheck enum repository interactions +6/-6

Check enum repository interactions

• Tightens object-argument matching in cache repository tests.

tests/Cache/CacheRepositoryEnumTest.php

CacheRepositoryTest.phpMake cache-repository doubles strict +49/-49

Make cache-repository doubles strict

• Rejects unexpected collaborator calls across repository tests.

tests/Cache/CacheRepositoryTest.php

CacheServiceProviderTest.phpMake cache-provider doubles strict +7/-7

Make cache-provider doubles strict

• Rejects unconfigured cache service-provider interactions.

tests/Cache/CacheServiceProviderTest.php

CacheStackStoreLocksTest.phpVerify stack lock handoffs +10/-10

Verify stack lock handoffs

• Checks identity-sensitive calls to stacked cache locks.

tests/Cache/CacheStackStoreLocksTest.php

CacheStackStoreTagsTest.phpVerify stacked tag behavior +17/-15

Verify stacked tag behavior

• Tightens tag-store expectations and directly checks resulting behavior.

tests/Cache/CacheStackStoreTagsTest.php

CacheStackStoreTest.phpMake stack-store doubles strict +2/-2

Make stack-store doubles strict

• Rejects unexpected stacked-store calls.

tests/Cache/CacheStackStoreTest.php

CacheSwooleStoreIntervalTest.phpTighten Swoole interval checks +12/-13

Tighten Swoole interval checks

• Adjusts interval test expectations to match observable calls.

tests/Cache/CacheSwooleStoreIntervalTest.php

CacheSwooleStoreTest.phpMake Swoole-store doubles strict +4/-4

Make Swoole-store doubles strict

• Rejects unconfigured Swoole cache-store calls.

tests/Cache/CacheSwooleStoreTest.php

CacheTaggedCacheTest.phpCheck tagged-cache arguments +9/-9

Check tagged-cache arguments

• Matches exact objects passed to tagged cache collaborators.

tests/Cache/CacheTaggedCacheTest.php

ClearCommandTest.phpCheck clear-command handoffs +5/-5

Check clear-command handoffs

• Uses identity-aware expectations for cache clearing.

tests/Cache/ClearCommandTest.php

ConcurrencyLimiterTest.phpTighten cache limiter expectation +1/-1

Tighten cache limiter expectation

• Checks the expected argument identity.

tests/Cache/ConcurrencyLimiterTest.php

ForgetCommandTest.phpCheck forget-command handoffs +4/-4

Check forget-command handoffs

• Matches original objects in cache forget command calls.

tests/Cache/ForgetCommandTest.php

ModelCacheCoordinatorTest.phpCheck model-cache coordination +36/-36

Check model-cache coordination

• Tightens instance matching in model-cache coordinator expectations.

tests/Cache/ModelCacheCoordinatorTest.php

ModelCacheStoreValidatorTest.phpSimplify cache-validator checks +11/-28

Simplify cache-validator checks

• Replaces weak matcher assertions with clearer checks of the validator's result.

tests/Cache/ModelCacheStoreValidatorTest.php

PruneStaleTagsCommandTest.phpCheck tag-pruning arguments +9/-9

Check tag-pruning arguments

• Tightens identity-sensitive command expectations.

tests/Cache/PruneStaleTagsCommandTest.php

AllTaggedCacheTest.phpTighten all-tagged cache expectations +35/-39

Tighten all-tagged cache expectations

• Matches exact objects and removes assertion side effects from matchers.

tests/Cache/Redis/AllTaggedCacheTest.php

AnyTaggedCacheTest.phpTighten any-tagged cache expectations +43/-48

Tighten any-tagged cache expectations

• Matches exact objects and checks results outside argument matchers.

tests/Cache/Redis/AnyTaggedCacheTest.php

BenchmarkCommandTest.phpCheck Redis benchmark arguments +11/-11

Check Redis benchmark arguments

• Uses identity-aware expectations in benchmark-command tests.

tests/Cache/Redis/Console/BenchmarkCommandTest.php

CleanupVerificationCheckTest.phpCheck cleanup verification handoffs +2/-2

Check cleanup verification handoffs

• Tightens expected collaborator object identity.

tests/Cache/Redis/Console/Doctor/Checks/CleanupVerificationCheckTest.php

DoctorCommandTest.phpCheck Redis doctor interactions +38/-38

Check Redis doctor interactions

• Uses exact-instance matchers for diagnostic collaborators.

tests/Cache/Redis/Console/DoctorCommandTest.php

FlushTest.phpCheck all-tag flush arguments +13/-13

Check all-tag flush arguments

• Tightens identity-sensitive Redis flush expectations.

tests/Cache/Redis/Operations/AllTag/FlushTest.php

GetEntriesTest.phpCheck all-tag entry arguments +2/-2

Check all-tag entry arguments

• Matches exact objects in entry retrieval expectations.

tests/Cache/Redis/Operations/AllTag/GetEntriesTest.php

AddTest.phpAssert any-tag add arguments after matching +15/-26

Assert any-tag add arguments after matching

• Captures Redis call arguments and checks them after the call rather than asserting inside matcher predicates.

tests/Cache/Redis/Operations/AnyTag/AddTest.php

DecrementTest.phpAssert decrement arguments after matching +5/-8

Assert decrement arguments after matching

• Moves Redis argument assertions out of matcher predicates.

tests/Cache/Redis/Operations/AnyTag/DecrementTest.php

FlushTest.phpCheck any-tag flush arguments +9/-9

Check any-tag flush arguments

• Tightens Redis flush expectation matching.

tests/Cache/Redis/Operations/AnyTag/FlushTest.php

ForeverTest.phpAssert forever arguments after matching +5/-9

Assert forever arguments after matching

• Captures and verifies Redis call arguments outside the matcher.

tests/Cache/Redis/Operations/AnyTag/ForeverTest.php

IncrementTest.phpAssert increment arguments after matching +5/-8

Assert increment arguments after matching

• Moves checks on matched Redis arguments into test assertions.

tests/Cache/Redis/Operations/AnyTag/IncrementTest.php

PutManyTest.phpAssert bulk-put arguments after matching +3/-8

Assert bulk-put arguments after matching

• Captures Redis arguments and verifies them after the call.

tests/Cache/Redis/Operations/AnyTag/PutManyTest.php

PutTest.phpVerify captured any-tag write arguments +12/-25

Verify captured any-tag write arguments

• Captures Lua script, keys, and expiration arguments, then asserts their contents after the write.

tests/Cache/Redis/Operations/AnyTag/PutTest.php

FlushTest.phpCheck Redis flush expectation +1/-1

Check Redis flush expectation

• Tightens the operation's call matching.

tests/Cache/Redis/Operations/FlushTest.php

PutManyTest.phpAssert Redis bulk-put arguments +8/-18

Assert Redis bulk-put arguments

• Moves assertions from matcher predicates to post-call checks.

tests/Cache/Redis/Operations/PutManyTest.php

RedisCacheTestCase.phpTighten shared Redis test double +1/-1

Tighten shared Redis test double

• Strengthens the common Redis test double used by cache tests.

tests/Cache/Redis/RedisCacheTestCase.php

RedisStoreTest.phpCheck Redis-store call arguments +8/-8

Check Redis-store call arguments

• Matches exact collaborator objects in store tests.

tests/Cache/Redis/RedisStoreTest.php

StoreContextTest.phpMake Redis store-context doubles strict +5/-5

Make Redis store-context doubles strict

• Rejects unconfigured calls to store-context collaborators.

tests/Cache/Redis/Support/StoreContextTest.php

RegisterSwooleMaintenanceTimersTest.phpMake maintenance-timer doubles strict +17/-17

Make maintenance-timer doubles strict

• Rejects unexpected scheduler interactions.

tests/Cache/RegisterSwooleMaintenanceTimersTest.php

ConnectionPoolTest.phpMake connection-pool doubles strict +8/-8

Make connection-pool doubles strict

• Rejects unconfigured connection-pool calls.

tests/ConnectionPool/ConnectionPoolTest.php

ConnectionTest.phpCheck pooled connection handoffs +47/-47

Check pooled connection handoffs

• Uses identity-aware matching for connection and pool interactions.

tests/ConnectionPool/ConnectionTest.php

FooPool.phpTighten pool test fixture +1/-1

Tighten pool test fixture

• Adjusts fixture double behavior to support strict pool expectations.

tests/ConnectionPool/Fixtures/FooPool.php

IdleConnectionMonitorTest.phpCheck idle-monitor arguments +12/-12

Check idle-monitor arguments

• Verifies exact connection objects in monitor calls.

tests/ConnectionPool/IdleConnectionMonitorTest.php

KeepaliveConnectionTest.phpMake keepalive doubles strict +6/-6

Make keepalive doubles strict

• Rejects unconfigured keepalive connection calls.

tests/ConnectionPool/KeepaliveConnectionTest.php

CacheCommandMutexTest.phpMake cache mutex doubles strict +3/-3

Make cache mutex doubles strict

• Rejects unexpected mutex collaborator calls.

tests/Console/CacheCommandMutexTest.php

CommandMutexTest.phpMake command mutex doubles strict +3/-3

Make command mutex doubles strict

• Rejects unexpected command-mutex interactions.

tests/Console/CommandMutexTest.php

CommandTest.phpCheck console command handoffs +18/-18

Check console command handoffs

• Uses identity-aware matching in command collaborator expectations.

tests/Console/CommandTest.php

InteractsWithIOTest.phpTighten console IO assertions +4/-6

Tighten console IO assertions

• Aligns IO collaborator expectations and removes redundant checks.

tests/Console/Concerns/InteractsWithIOTest.php

ConfiguresPromptsTest.phpTighten prompt configuration tests +16/-20

Tighten prompt configuration tests

• Makes prompt interaction checks more explicit and removes weak assertions.

tests/Console/ConfiguresPromptsTest.php

ConsoleApplicationDeferredCallbacksTest.phpCheck deferred callback identity +1/-1

Check deferred callback identity

• Matches the original callback-related object.

tests/Console/ConsoleApplicationDeferredCallbacksTest.php

ConsoleApplicationTest.phpCheck console application arguments +2/-2

Check console application arguments

• Tightens object-identity expectations.

tests/Console/ConsoleApplicationTest.php

EventsTest.phpCheck console event handoffs +9/-9

Check console event handoffs

• Matches exact event objects in dispatcher expectations.

tests/Console/Events/EventsTest.php

FooExceptionCommand.phpTighten exception-command fixture +1/-1

Tighten exception-command fixture

• Adjusts its expected exception interaction for strict testing.

tests/Console/Fixtures/Commands/FooExceptionCommand.php

FooExitCommand.phpTighten exit-command fixture +1/-1

Tighten exit-command fixture

• Adjusts the fixture's interaction expectation.

tests/Console/Fixtures/Commands/FooExitCommand.php

GeneratorCommandTest.phpCheck generator-command arguments +10/-10

Check generator-command arguments

• Uses identity-aware collaborator expectations.

tests/Console/GeneratorCommandTest.php

InteractsWithSignalsTest.phpVerify console signal interactions +7/-5

Verify console signal interactions

• Tightens signal expectations and checks resulting behavior.

tests/Console/InteractsWithSignalsTest.php

MigrationGeneratorCommandTest.phpCheck migration-generator handoff +1/-1

Check migration-generator handoff

• Makes an object argument expectation identity-aware.

tests/Console/MigrationGeneratorCommandTest.php

EventTest.phpMake scheduled-event doubles strict +71/-59

Make scheduled-event doubles strict

• Uses strict mutex, filesystem, process, and other collaborators; consolidates process-double setup for the tested calls.

tests/Console/Scheduling/EventTest.php

ScheduleRunCommandTest.phpStrictly verify schedule runs +82/-84

Strictly verify schedule runs

• Rejects unexpected scheduling collaborator calls and tightens related assertions.

tests/Console/Scheduling/ScheduleRunCommandTest.php

ScheduleRunContextPropagationTest.phpCheck scheduling context handoffs +6/-6

Check scheduling context handoffs

• Matches exact objects passed through schedule-run context.

tests/Console/Scheduling/ScheduleRunContextPropagationTest.php

ScheduleTest.phpCheck schedule arguments +10/-10

Check schedule arguments

• Tightens instance matching in scheduling expectations.

tests/Console/Scheduling/ScheduleTest.php

ComponentsTest.phpTighten console component assertions +4/-6

Tighten console component assertions

• Removes redundant checks and verifies relevant component behavior.

tests/Console/View/ComponentsTest.php

ContextualAttributeBindingTest.phpCheck contextual binding handoffs +50/-50

Check contextual binding handoffs

• Matches exact container and resolved objects in binding tests.

tests/Container/ContextualAttributeBindingTest.php

CookieJarTest.phpTighten cookie-jar expectation +1/-1

Tighten cookie-jar expectation

• Checks original object identity in a collaborator call.

tests/Cookie/CookieJarTest.php

AddQueuedCookiesToResponseTest.phpCheck cookie middleware response identity +1/-1

Check cookie middleware response identity

• Verifies that the expected response instance is passed through.

tests/Cookie/Middleware/AddQueuedCookiesToResponseTest.php

TimerTest.phpTighten timer double expectations +6/-6

Tighten timer double expectations

• Strengthens strictness and object matching for timer collaborators.

tests/Coordinator/TimerTest.php

LifecycleCallbackTest.phpCheck lifecycle callback arguments +4/-4

Check lifecycle callback arguments

• Verifies exact objects passed into callback handling.

<a href='https://github.com/hypervel/components-backup/pull/114/files#diff-cb6ccb3b47a4e2c0dfb1a9...

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The follow-up changes appear safe to merge; the earlier cleanup-reporting issue is non-blocking.

Fix All in Claude CodeFindings

  1. P2 Cleanup errors disappear ▶

Summary

This PR restores strict test doubles, object identity checks, and direct assertions across the suite, and makes idle database cleanup attempt every lease.

  • Idle database cleanup tries every lease before reporting a failure.
  • Tests across the suite now fail on unexpected calls to their doubles.
  • Permission and Reverb tests check the results they describe.

No new issues found in the follow-up changes. Tests were not run because dependencies are not installed.

Reviews (2) · Last reviewed commit: "Allow unrelated application reads in the..." · Reviewed by Greptile

Comment on lines +267 to +268
} catch (Throwable $exception) {
$failure = Coroutine::preferCancellation($failure, $exception);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Cleanup errors disappear

When one lease throws a normal cleanup error and a later lease throws CanceledException, this call replaces the first error without reporting or chaining it. The first error used to reach the caller; now only cancellation escapes. Later normal errors are also silently dropped once a failure is kept.

Report each displaced error while still draining every lease. FailureReporter::preferCancellation() already preserves the same priority while reporting the error that loses it.

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Idle release now tries every lease and then propagates the first failure, with cancellation taking precedence. This follows the cleanup behavior documented in the coroutine guide and used by terminateConnections() and closePools(). The two-lease regression covers both ordinary failure and cancellation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed. I treated displaced cleanup errors as needing separate reporting, but that does not match the established cleanup contract here: terminateConnections() and closePools() also drain all resources, then propagate one selected failure with cancellation taking precedence. The two-lease regression covers that behavior. I withdraw the finding; no additional error reporting is needed.

Use a connected client in atomic mode on the default database for ordinary releases. This exercises the pool return path after clearing WATCH state and preserves the mode check.
Guzzle checks the stream timeout metadata when a read throws. Give it a negative result so the body export test exercises the original read failure and verifies that the caller keeps its open resource.
Return the route middleware for the deferred WebSocket handshake. Allow the SDK to look up its optional OTLP integration when another test has installed the process-wide propagation callback.
The caster visits several application properties. Require the failing property and the later version lookup while allowing the other reads to return their defaults.
@binaryfire

Copy link
Copy Markdown
Member Author

The root development dependency follows Double master deliberately so the suite can use the fix for caught expectation failures. A fresh install can pick up upstream changes, and CI exercises that combination. This requirement applies only to contributors running the framework test suite.

@binaryfire
binaryfire merged commit ad9309d into 0.4 Nov 18, 2026
45 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.

1 participant