Visitar URL original
Notice "2x WARNING: Timeout: Some coverage data is not included in the coverage report." always appears · Issue #6837 · Codeception/Codeception · GitHub
Skip to content

Notice "2x WARNING: Timeout: Some coverage data is not included in the coverage report." always appears #6837

Description

@vjik

This notice always appears after suite with functional tests.

I'm tried with one file for coverage. There are notices.

How to fix it?

Activity

  1. particleflux commented on Jul 17, 2026

    @particleflux

    I found something out about this...

    Seems this warning is incorrectly shown when \Codeception\Coverage\Subscriber\LocalServer::waitForFile() is waiting on coverage file.

    That method is called for both the "block_report" file, where it is correct, and the serialized coverage file, where it is incorrect:

    $this->waitForFile($blockFile, 120, 250_000);
    $this->waitForFile($coverageFile, 5, 500_000);

    For the coverage.serialized, it should not check for file content != '0', otherwise it waits for coverage file contents to be exactly 0 - and logs the warning if it never gets there.

    if (!file_exists($file) || file_get_contents($file) !== '0') {
    Notification::warning('Timeout: Some coverage data is not included in the coverage report.', '');
    }

    In the case of the coverage.serialized, tho, the warning is wrong, as it opens it again afterwards anyway.

    Suggested fix, sth like this:

    --- old/LocalServer.php	2026-02-18 07:18:00.000000000 +0100
    +++ new/LocalServer.php	2026-07-17 20:30:54.556825254 +0200
    @@ -149,8 +149,8 @@
             $coverageFile = $outputDir . 'codecoverage.serialized';
             $errorFile = $outputDir . 'error.txt';
     
    -        $this->waitForFile($blockFile, 120, 250_000);
    -        $this->waitForFile($coverageFile, 5, 500_000);
    +        $this->waitForFile($blockFile, 220, 250_000, true);
    +        $this->waitForFile($coverageFile, 5, 500_000, false);
     
             if (!file_exists($coverageFile)) {
                 throw new RuntimeException(
    @@ -318,15 +318,17 @@
             }
         }
     
    -    private function waitForFile(string $file, int $maxRetries, int $sleepTime): void
    +    private function waitForFile(string $file, int $maxRetries, int $sleepTime, bool $isBlockFile): void
         {
             $retries = $maxRetries;
    -        while ($retries > 0 && (!file_exists($file) || file_get_contents($file) !== '0')) {
    +        while ($retries > 0 && (!file_exists($file) || ($isBlockFile && file_get_contents($file) !== '0'))) {
                 usleep($sleepTime);
                 --$retries;
             }
     
    -        if (!file_exists($file) || file_get_contents($file) !== '0') {
    +        if (!file_exists($file) || ($isBlockFile && file_get_contents($file) !== '0')) {
                 Notification::warning('Timeout: Some coverage data is not included in the coverage report.', '');
             }
         }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions