Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct lock constant when stream wrapper locks the file #16

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

maks-rafalko
Copy link
Member

@maks-rafalko maks-rafalko commented Aug 9, 2021

$operation contains 0 value which results to ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN

So we explicitly use LOCK_SH

Fixes failed builds for infection/infection#1549

Background:

PHPUnit sets an exclusive lock when flushed results into .phpunit.result.cache file, here

https://github.com/sebastianbergmann/phpunit/blob/83ff29a80f63b8354be60e057c1dad37cc04570b/src/Runner/DefaultTestResultCache.php#L144

and our stream wrapper was not ready for it - it failed with the error above.

$operation contains `0` value which results to `ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN`

So we explicitly use `LOCK_SH`
@maks-rafalko maks-rafalko merged commit 0cc76d9 into master Aug 9, 2021
@maks-rafalko maks-rafalko deleted the feature/flock branch August 9, 2021 10:03
@jacyimp jacyimp mentioned this pull request Jan 31, 2023
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