fix: --retry with parallel

This commit is contained in:
Nuno Maduro
2023-02-11 17:39:46 +00:00
parent 6ddc5c8572
commit 052b9e051b
11 changed files with 67 additions and 28 deletions

View File

@ -6,7 +6,7 @@ use Pest\Support\Str;
// HACK: we have to determine our $_SERVER['globalHook-]>calls baseline. This is because
// two other tests are executed before this one due to filename ordering.
$args = $_SERVER['argv'] ?? [];
$single = (isset($args[1]) && Str::endsWith(__FILE__, $args[1])) || Parallel::isInParallelProcess();
$single = (isset($args[1]) && Str::endsWith(__FILE__, $args[1])) || Parallel::isWorker();
$offset = $single ? 0 : 2;
uses()->beforeAll(function () use ($offset) {