FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

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

Repository navigation

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

Open

Description

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

    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.', '');
             }
         }
    
  2. gl636474 commented on Oct 14, 2026

    I wish I saw your post @particleflux - I spent days on this and came to exactly the same conclusion as I first assumed it was my code causing the issue. Further evidence that it is not due to tests overrunning...

    I added the following code to __c3__testcounter() in c3.php:

    error_log(sprintf('c3counter %s %s %s => %s',
    $decrease ? 'down' : 'up',
    $_SERVER['REQUEST_URI'] ?? '?',
    date('H:i:s'),
    $testcounter));

    And it produced the following output:

    [Wed Oct 14 23:42:58.914566 2026] [php:notice] [pid 25401] [client ::1:56119] c3counter up /autotest/wordpress/wp-json/wp/v2/users/me?context=edit&_locale=user 22:42:58 => 1, referer: http://localhost:8080/autotest/wordpress/wp-admin/
    [Wed Oct 14 23:43:01.086088 2026] [php:notice] [pid 25343] [client ::1:56123] c3counter up /autotest/wordpress/wp-json/wp/v2/users/me?context=edit&_locale=user 22:43:01 => 2, referer: http://localhost:8080/autotest/wordpress/wp-admin/admin.php?page=simple-google-appointments-calendars
    [Wed Oct 14 23:43:03.886996 2026] [php:notice] [pid 25400] [client ::1:56118] c3counter up /autotest/wordpress/wp-json/wp/v2/users/me?context=edit&_locale=user 22:43:03 => 3, referer: http://localhost:8080/autotest/wordpress/wp-admin/admin.php?page=simple-google-appointments-calendars
    [Wed Oct 14 23:43:03.886977 2026] [php:notice] [pid 25401] [client ::1:56119] c3counter down /autotest/wordpress/wp-json/wp/v2/users/me?context=edit&_locale=user 22:43:03 => 2, referer: http://localhost:8080/autotest/wordpress/wp-admin/
    [Wed Oct 14 23:43:05.223728 2026] [php:notice] [pid 25343] [client ::1:56123] c3counter down /autotest/wordpress/wp-json/wp/v2/users/me?context=edit&_locale=user 22:43:05 => 1, referer: http://localhost:8080/autotest/wordpress/wp-admin/admin.php?page=simple-google-appointments-calendars
    [Wed Oct 14 23:43:06.394706 2026] [php:notice] [pid 25400] [client ::1:56118] c3counter down /autotest/wordpress/wp-json/wp/v2/users/me?context=edit&_locale=user 22:43:06 => 0, referer: http://localhost:8080/autotest/wordpress/wp-admin/admin.php?page=simple-google-appointments-calendars

    So the test returned within a second or so!? Hopefully this is useful to someone.

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


      Back | FazBrowse Home | New Git URL