Skip to content

fix: support tests outside Tests\ namespace in sharding#1714

Open
YoussefMansour9 wants to merge 3 commits into
pestphp:4.xfrom
YoussefMansour9:fix/shard-modular-apps
Open

fix: support tests outside Tests\ namespace in sharding#1714
YoussefMansour9 wants to merge 3 commits into
pestphp:4.xfrom
YoussefMansour9:fix/shard-modular-apps

Conversation

@YoussefMansour9

@YoussefMansour9 YoussefMansour9 commented May 18, 2026

Copy link
Copy Markdown

When running tests in parallel mode (--parallel), testErroredEvents() can return AfterLastTestMethodErrored events. The existing code assumed all non-Errored events were BeforeFirstTestMethodErrored, causing a TypeError when an AfterLastTestMethodErrored event was passed to fromBeforeFirstTestMethodErrored().

The fix adds an explicit instanceof check for BeforeFirstTestMethodErrored instead of the catch-all else, allowing AfterLastTestMethodErrored events to be safely skipped.

Fixes #1623

Youssef Mansour and others added 3 commits May 19, 2026 01:16
…ypeError in parallel mode

When running tests in parallel mode (--parallel), testErroredEvents() can
return AfterLastTestMethodErrored events. The existing code assumed all
non-Errored events were BeforeFirstTestMethodErrored, causing a TypeError
when an AfterLastTestMethodErrored event was passed to
fromBeforeFirstTestMethodErrored().

The fix adds an explicit instanceof check for
BeforeFirstTestMethodErrored instead of the catch-all else, allowing
AfterLastTestMethodErrored events to be safely skipped.

Fixes pestphp#1623
@YoussefMansour9 YoussefMansour9 force-pushed the fix/shard-modular-apps branch from 91eb4c4 to 7e798a1 Compare June 2, 2026 01:20
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.

[Bug]: StateGenerator TypeError with AfterLastTestMethodErrored in parallel mode

1 participant