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

Windows does not support exclusive locks on stdout #5770

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Mar 26, 2024

prevent errors like

$ php ./phpunit tests/end-to-end/regression/5764/5764.phpt  --configuration tests/end-to-end/regression/5764/phpunit.xml --do-not-cache-result --debug

An error occurred inside PHPUnit.

Message:  file_put_contents(): Exclusive locks are not supported for this stream
Location: C:\dvl\Workspace\phpunit\src\Logging\EventLogger.php:44

#0 [internal function]: PHPUnit\TextUI\Application->{closure}()
#1 C:\dvl\Workspace\phpunit\src\Logging\EventLogger.php(44): file_put_contents()
#2 C:\dvl\Workspace\phpunit\src\Event\Dispatcher\DirectDispatcher.php(88): PHPUnit\Logging\EventLogger->trace()
#3 C:\dvl\Workspace\phpunit\src\Event\Dispatcher\DeferringDispatcher.php(53): PHPUnit\Event\DirectDispatcher->dispatch()
#4 C:\dvl\Workspace\phpunit\src\Event\Facade.php(121): PHPUnit\Event\DeferringDispatcher->flush()
#5 C:\dvl\Workspace\phpunit\src\TextUI\Application.php(190): PHPUnit\Event\Facade->seal()
#6 C:\dvl\Workspace\phpunit\phpunit(104): PHPUnit\TextUI\Application->run()
#7 {main}

see php/php-src#13777

I was not able to reproduce this CLI command in a regression test

@clxmstaab clxmstaab force-pushed the no-lock-ex branch 2 times, most recently from 13dee98 to 78eb14c Compare March 26, 2024 15:54
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.09%. Comparing base (406a2b4) to head (7536e86).

Additional details and impacted files
@@            Coverage Diff            @@
##               10.5    #5770   +/-   ##
=========================================
  Coverage     90.09%   90.09%           
- Complexity     6445     6447    +2     
=========================================
  Files           680      680           
  Lines         19554    19557    +3     
=========================================
+ Hits          17617    17620    +3     
  Misses         1937     1937           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@staabm
Copy link
Contributor Author

staabm commented Mar 27, 2024

after this change:

$ php ./phpunit tests/end-to-end/regression/5764/5764.phpt  --configuration tests/end-to-end/regression/5764/phpunit.xml --do-not-cache-result --debug
PHPUnit Started (PHPUnit 10.5.15-11-g78eb14c51 using PHP 8.2.12 (cli) on WINNT)
Test Runner Configured
Bootstrap Finished (C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\error-handler.php)
Test Suite Loaded (1 test)
Event Facade Sealed
Test Runner Started
Test Suite Sorted
Test Runner Execution Started (1 test)
Test Suite Started (C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\5764.phpt, 1 test)
Test Preparation Started (C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\5764.phpt)
Test Prepared (C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\5764.phpt)
Assertion Succeeded (Constraint: matches format description:
PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s
Configuration: %s

There was 1 PHPUnit test runner warning:

1) No tests found in class "PHPUnit\TestFixture\Issue5764\Issue5764Test".

No tests executed!, Value: 'PHPUnit 10.5.15-11-g78eb14c51 by Sebastian Bergmann and contributors.\n
\n
Runtime:       PHP 8.2.12\n
Configuration: C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\phpunit.xml\n
\n
There was 1 PHPUnit test runner warning:\n
\n
1) No tests found in class "PHPUnit\TestFixture\Issue5764\Issue5764Test".\n
\n
No tests executed!')
Test Finished (C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\5764.phpt)
Test Suite Finished (C:\dvl\Workspace\phpunit\tests\end-to-end\regression\5764\5764.phpt, 1 test)
Test Runner Execution Finished
Test Runner Finished
PHPUnit Finished (Shell Exit Code: 0)

@sebastianbergmann sebastianbergmann merged commit 5e80471 into sebastianbergmann:10.5 Mar 28, 2024
31 checks passed
@sebastianbergmann sebastianbergmann added type/bug Something is broken platform/windows Issues specific to the Windows platform labels Mar 28, 2024
@staabm staabm deleted the no-lock-ex branch March 28, 2024 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/windows Issues specific to the Windows platform type/bug Something is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants