Skip to content

[TypeDeclaration] Point ReturnNullableTypeRectorPhp82Test to its own fixtures and config - #8517

Merged
samsonasik merged 1 commit into
rectorphp:mainfrom
GErpeldinger:return-nullable-php82-own-fixtures
Sep 23, 2026
Merged

samsonasik merged 1 commit into
rectorphp:mainfrom
GErpeldinger:return-nullable-php82-own-fixtures

Conversation

@GErpeldinger

Copy link
Copy Markdown
Contributor

Since #6110, ReturnNullableTypeRectorPhp82Test reads Fixture/ with configured_rule.php, the same as ReturnNullableTypeRectorTest. On main, both classes run the same 3 fixtures, and FixturePhp82/standalone_nullable_false.php.inc with configured_rule_php82.php never runs:

$ vendor/bin/phpunit rules-tests/TypeDeclaration/Rector/ClassMethod/ReturnNullableTypeRector/ReturnNullableTypeRectorPhp82Test.php --list-tests
Fixture/nullable_false_to_nullable_bool.php.inc
Fixture/return_nullable_int.php.inc
Fixture/skip_nullable_mixed.php.inc

Both classes also write the same temporary files next to these fixtures. When fast-unit runs them in parallel chunks, one deletes the other's file, and the test fails randomly, as on #8512: https://github.com/rectorphp/rector-src/actions/runs/35795193352

The test now reads FixturePhp82/ with configured_rule_php82.php.

Split from #8512, as asked there.

🤖 Drafted with AI assistance.

@TomasVotruba
TomasVotruba enabled auto-merge (squash) September 23, 2026 14:30
@samsonasik

Copy link
Copy Markdown
Member

@TomasVotruba fastunit seems has random error test, even on main branch

It read the same Fixture directory with the default config, so FixturePhp82
and configured_rule_php82.php never ran, and both test classes wrote the
same temporary input files, which fails randomly when the chunks run in
parallel (hash_file on a file the other class just deleted).
auto-merge was automatically disabled September 23, 2026 14:35

Head branch was pushed to by a user without write access

@GErpeldinger
GErpeldinger force-pushed the return-nullable-php82-own-fixtures branch from c339092 to b5a1cad Compare September 23, 2026 14:35
@samsonasik
samsonasik enabled auto-merge (squash) September 23, 2026 14:36
@TomasVotruba

Copy link
Copy Markdown
Member

👌

@GErpeldinger

Copy link
Copy Markdown
Contributor Author

@samsonasik Normally the problem is fixed with the merge of #8513, i rebased this branch since tomas merged it

@samsonasik
samsonasik merged commit dd3bfc4 into rectorphp:main Sep 23, 2026
45 checks passed
@samsonasik

Copy link
Copy Markdown
Member

@GErpeldinger good, thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants