`SourceMap` is built in child process even though `identifyIssueTrigger` is disabled · Issue #6904 · sebastianbergmann/phpunit · GitHub
Skip to content

SourceMap is built in child process even though identifyIssueTrigger is disabled #6904

Closed

Description

@SystemKeeper
Q A
PHPUnit version 12.5.33 (reproduced, although first seen in 11.5.56)
PHP version 8.3.32
Installation Method Composer

Summary

The attribute identifyIssueTrigger was specifically introduced to prevent extensive filesystem operations (see linked issue/commit). This works fine as long as the test does not run separately, in this case the source map is still built in the child process.

Current behavior

While #6495 improved the situation in so far, that the parent shares the map with the child processes, it does not take into account when no source map was build in the parent.

How to reproduce

<?php

use PHPUnit\Framework\Attributes\PreserveGlobalState;
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
use PHPUnit\Framework\TestCase;

final class IsolationTest extends TestCase {
	public function testPlain(): void {
		$this->assertTrue(true);
	}

	#[RunInSeparateProcess]
	#[PreserveGlobalState(enabled: false)]
	public function testIsolated(): void {
		$this->assertTrue(true);
	}
}

with

<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/12.5/phpunit.xsd">
    <testsuite name="repro">
        <directory>tests</directory>
    </testsuite>
    <source identifyIssueTrigger="false">
        <include>
            <directory>src</directory>
        </include>
    </source>
</phpunit>

Expected behavior

None of the tests should try to built a source map.

Test output

(depends on the number of source files of course, here I added random files to show the difference)

root@67c7f7d1d4ea:/var/www/html/repo# time vendor/bin/phpunit -c with-source.xml
PHPUnit 12.5.33 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.32
Configuration: /var/www/html/repo/with-source.xml

..                                                                  2 / 2 (100%)

Time: 00:00.785, Memory: 12.00 MB

OK (2 tests, 2 assertions)

real	0m0.980s
user	0m0.162s
sys	0m0.122s

root@67c7f7d1d4ea:/var/www/html/repo# time vendor/bin/phpunit -c with-source.xml --filter testPlain
PHPUnit 12.5.33 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.32
Configuration: /var/www/html/repo/with-source.xml

.                                                                   1 / 1 (100%)

Time: 00:00, Memory: 6.00 MB

OK (1 test, 1 assertion)

real	0m0.164s
user	0m0.071s
sys	0m0.028s

Activity

  1. lazerg commented on Aug 16, 2026

    @lazerg
    Contributor

    I will work on it

  2. changed the title [-]SourceMap is built in child process even though `identifyIssueTrigger` is disabled[/-] [+]`SourceMap` is built in child process even though `identifyIssueTrigger` is disabled[/+] on Aug 17, 2026
  3. added 2 commits that reference this issue on Aug 17, 2026
    35c032b
    bde2609
  4. SystemKeeper commented on Aug 17, 2026

    @SystemKeeper
    Author

    Thanks a lot for tackling and merging this so fast!

  5. added a commit that references this issue on Aug 24, 2026
  6. added 2 commits that reference this issue on Sep 1, 2026
    d3368ff
    f06aea4
  7. locked as resolved and limited conversation to collaborators on Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions