Skip to content

Missing event when child process ends unexpectedly #6134

@sebastianbergmann

Description

@sebastianbergmann

tests/Issue6134Test.php

<?php declare(strict_types=1);
namespace PHPUnit\TestFixture\Issue6134;

use PHPUnit\Framework\TestCase;

final class Issue6134Test extends TestCase
{
    public function testOne(): void
    {
        exit;
    }
}
❯ ./tools/phpunit --process-isolation tests/Issue6134Test.php
PHPUnit 12.0.3 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.4
Configuration: /home/sb/issue-6134/phpunit.xml

E                                                                   1 / 1 (100%)

Time: 00:00.147, Memory: 25.29 MB

There was 1 error:

1) PHPUnit\TestFixture\Issue6134\Issue6134Test::testOne
Test was run in child process and ended unexpectedly

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
❯ ./tools/phpunit --process-isolation --debug tests/Issue6134Test.php
PHPUnit Started (PHPUnit 12.0.3 using PHP 8.4.4 (cli) on Linux)
Test Runner Configured
Event Facade Sealed
Test Suite Loaded (1 test)
Test Runner Started
Test Suite Sorted
Test Runner Execution Started (1 test)
Test Suite Started (PHPUnit\TestFixture\Issue6134\Issue6134Test, 1 test)
Child Process Started
Test Errored (PHPUnit\TestFixture\Issue6134\Issue6134Test::testOne)
Test was run in child process and ended unexpectedly
Test Finished (PHPUnit\TestFixture\Issue6134\Issue6134Test::testOne)
Test Suite Finished (PHPUnit\TestFixture\Issue6134\Issue6134Test, 1 test)
Test Runner Execution Finished
Test Runner Finished
PHPUnit Finished (Shell Exit Code: 2)

In the above, we only see a Child Process Started event. We do not see an event that the child process finished (unsuccessfully).

Metadata

Metadata

Labels

feature/eventsIssues related to PHPUnit's event systemfeature/process-isolationIssues related to running tests in separate PHP processesfeature/test-runnerCLI test runnertype/bugSomething is brokenversion/11Something affects PHPUnit 11version/12Something affects PHPUnit 12

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions