@@ -1307,7 +1307,12 @@ function run_all_tests(array $test_files, array $env, ?string $redir_tested = nu
13071307 }
13081308
13091309 /* Ignore -jN if there is only one file to analyze. */
1310- if ($ workers !== null && count ($ test_files ) > 1 && !$ workerID ) {
1310+ if (
1311+ $ workers !== null
1312+ && count ($ test_files ) > 1
1313+ && !$ workerID
1314+ && $ redir_tested === null
1315+ ) {
13111316 run_all_tests_parallel ($ test_files , $ env , $ redir_tested );
13121317 return ;
13131318 }
@@ -1362,7 +1367,7 @@ function run_all_tests(array $test_files, array $env, ?string $redir_tested = nu
13621367
13631368function run_all_tests_parallel (array $ test_files , array $ env , ?string $ redir_tested ): void
13641369{
1365- global $ workers , $ test_idx , $ test_results , $ failed_tests_file , $ result_tests_file , $ PHP_FAILED_TESTS , $ shuffle , $ valgrind , $ show_progress ;
1370+ global $ workers , $ test_cnt , $ test_idx , $ test_results , $ failed_tests_file , $ result_tests_file , $ PHP_FAILED_TESTS , $ shuffle , $ valgrind , $ show_progress ;
13661371
13671372 global $ junit ;
13681373
@@ -1544,6 +1549,9 @@ function run_all_tests_parallel(array $test_files, array $env, ?string $redir_te
15441549 }
15451550
15461551 switch ($ message ["type " ]) {
1552+ case "test_count_delta " :
1553+ $ test_cnt += $ message ["delta " ];
1554+ break ;
15471555 case "tests_finished " :
15481556 $ testsInProgress --;
15491557 foreach ($ activeConflicts as $ key => $ workerId ) {
@@ -1846,7 +1854,7 @@ function run_test(string $php, $file, array $env): string
18461854 global $ preload , $ file_cache ;
18471855 global $ num_repeats ;
18481856 // Parallel testing
1849- global $ workerID ;
1857+ global $ workerID, $ workerSock ;
18501858 global $ show_progress ;
18511859
18521860 // Temporary
@@ -2255,7 +2263,14 @@ function run_test(string $php, $file, array $env): string
22552263 $ test_files [] = [$ f , $ file ];
22562264 }
22572265 }
2258- $ test_cnt += count ($ test_files ) - 1 ;
2266+ $ testCountDelta = count ($ test_files ) - 1 ;
2267+ $ test_cnt += $ testCountDelta ;
2268+ if ($ workerID && $ testCountDelta !== 0 ) {
2269+ send_message ($ workerSock , [
2270+ "type " => "test_count_delta " ,
2271+ "delta " => $ testCountDelta ,
2272+ ]);
2273+ }
22592274 $ test_idx --;
22602275
22612276 show_redirect_start ($ IN_REDIRECT ['TESTS ' ], $ tested , $ tested_file );
0 commit comments