Files
pest/tests/Unit/Support/Git.php
T
Jhon Farias 8c635c5ba0 fix(tia): report a git timeout like any other git failure (#2069)
* fix(tia): report a git timeout like any other git failure

* fix(tia): raise a git timeout so no git helper reads it as an answer

* test(tia): cover a slow git check-ignore and stop probing git after a timeout

---------

Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
2026-11-30 18:38:29 +05:30

14 lines
476 B
PHP

<?php
declare(strict_types=1);
use Pest\Exceptions\GitTimedOut;
use Pest\Support\Git;
it('raises a timed out command instead of answering', function (string $method): void {
$git = new Git(timeout: 0.2);
expect(fn (): mixed => $git->{$method}(['-c', 'alias.slow=!sleep 5', 'slow']))
->toThrow(GitTimedOut::class, 'Git did not answer within 0.2 seconds: git -c alias.slow=!sleep 5 slow');
})->with(['result', 'raw', 'output', 'succeeds'])->skipOnWindows();