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

Missing event when child process ends unexpectedly #6134

Closed
sebastianbergmann opened this issue Feb 18, 2025 · 0 comments
Closed

Missing event when child process ends unexpectedly #6134

sebastianbergmann opened this issue Feb 18, 2025 · 0 comments
Assignees
Labels
feature/events Issues related to PHPUnit's event system feature/process-isolation Issues related to running tests in separate PHP processes feature/test-runner CLI test runner type/bug Something is broken version/11 Something affects PHPUnit 11 version/12 Something affects PHPUnit 12

Comments

@sebastianbergmann
Copy link
Owner

sebastianbergmann commented Feb 18, 2025

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).

@sebastianbergmann sebastianbergmann added feature/events Issues related to PHPUnit's event system feature/process-isolation Issues related to running tests in separate PHP processes feature/test-runner CLI test runner type/bug Something is broken version/11 Something affects PHPUnit 11 version/12 Something affects PHPUnit 12 labels Feb 18, 2025
@sebastianbergmann sebastianbergmann self-assigned this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/events Issues related to PHPUnit's event system feature/process-isolation Issues related to running tests in separate PHP processes feature/test-runner CLI test runner type/bug Something is broken version/11 Something affects PHPUnit 11 version/12 Something affects PHPUnit 12
Projects
None yet
Development

No branches or pull requests

1 participant