Skip to content

Commit

Permalink
Closes #6134
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 19, 2025
1 parent 94dc922 commit 03050de
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions ChangeLog-11.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes of the PHPUnit 11.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.

## [11.5.9] - 2025-MM-DD

### Fixed

* [#6134](https://github.com/sebastianbergmann/phpunit/issues/6134): Missing event when child process ends unexpectedly

## [11.5.8] - 2025-02-18

### Fixed
Expand Down Expand Up @@ -105,6 +111,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
* [#6055](https://github.com/sebastianbergmann/phpunit/issues/6055): `assertNotContainsOnly()` (use `assertContainsNotOnlyArray()`, `assertContainsNotOnlyBool()`, `assertContainsNotOnlyCallable()`, `assertContainsNotOnlyFloat()`, `assertContainsNotOnlyInt()`, `assertContainsNotOnlyIterable()`, `assertContainsNotOnlyNumeric()`, `assertContainsNotOnlyObject()`, `assertContainsNotOnlyResource()`, `assertContainsNotOnlyClosedResource()`, `assertContainsNotOnlyScalar()`, or `assertContainsNotOnlyString()` instead)
* [#6059](https://github.com/sebastianbergmann/phpunit/issues/6059): `containsOnly()` (use `containsOnlyArray()`, `containsOnlyBool()`, `containsOnlyCallable()`, `containsOnlyFloat()`, `containsOnlyInt()`, `containsOnlyIterable()`, `containsOnlyNumeric()`, `containsOnlyObject()`, `containsOnlyResource()`, `containsOnlyClosedResource()`, `containsOnlyScalar()`, or `containsOnlyString()` instead)

[11.5.9]: https://github.com/sebastianbergmann/phpunit/compare/11.5.8...11.5
[11.5.8]: https://github.com/sebastianbergmann/phpunit/compare/11.5.7...11.5.8
[11.5.7]: https://github.com/sebastianbergmann/phpunit/compare/11.5.6...11.5.7
[11.5.6]: https://github.com/sebastianbergmann/phpunit/compare/11.5.5...11.5.6
Expand Down
2 changes: 0 additions & 2 deletions src/Framework/TestRunner/templates/class.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ function __phpunit_run_isolated_test()
}
}

Facade::emitter()->testRunnerFinishedChildProcess($output, '');

file_put_contents(
'{processResultFile}',
serialize(
Expand Down
2 changes: 0 additions & 2 deletions src/Framework/TestRunner/templates/method.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ function __phpunit_run_isolated_test()
}
}

Facade::emitter()->testRunnerFinishedChildProcess($output, '');

file_put_contents(
'{processResultFile}',
serialize(
Expand Down
4 changes: 2 additions & 2 deletions src/Util/PHP/DefaultJobRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ private function runProcess(Job $job, ?string $temporaryFile): Result
$environmentVariables,
);

Facade::emitter()->testRunnerStartedChildProcess();

if (!is_resource($process)) {
// @codeCoverageIgnoreStart
throw new PhpProcessException(
Expand All @@ -128,6 +126,8 @@ private function runProcess(Job $job, ?string $temporaryFile): Result
// @codeCoverageIgnoreEnd
}

Facade::emitter()->testRunnerStartedChildProcess();

fwrite($pipes[0], $job->code());
fclose($pipes[0]);

Expand Down
3 changes: 3 additions & 0 deletions src/Util/PHP/JobRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use function file_get_contents;
use function is_file;
use function unlink;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\ChildProcessResultProcessor;
use PHPUnit\Framework\Test;

Expand Down Expand Up @@ -52,6 +53,8 @@ final public function runTestJob(Job $job, string $processResultFile, Test $test
$processResult,
$result->stderr(),
);

EventFacade::emitter()->testRunnerFinishedChildProcess($result->stdout(), $result->stderr());
}

abstract public function run(Job $job): Result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Child Process Started
Test Errored (PHPUnit\TestFixture\Event\SeparateProcessesTest::testOne)
Test was run in child process and ended unexpectedly
Test Finished (PHPUnit\TestFixture\Event\SeparateProcessesTest::testOne)
Child Process Finished
Test Suite Finished (PHPUnit\TestFixture\Event\SeparateProcessesTest, 1 test)
Test Runner Execution Finished
Test Runner Finished
Expand Down

0 comments on commit 03050de

Please sign in to comment.