Only retry failed pexpect tests under CI

A false negative while testing locally should be a rare thing, and individual
pexpect tests already take too long in case of a non-match making for a painful
edit-test loop.
This commit is contained in:
Mahmoud Al-Qudsi 2022-10-25 13:32:34 -05:00
parent 21599a49ea
commit 3913b28153

View File

@ -64,8 +64,14 @@ if not python3 -c 'import pexpect'
end
for i in $pexpect_files_to_test
if not test_pexpect_file $i
say yellow "Trying $i for a second time"
if not test_pexpect_file $i
# Retry pexpect tests under CI twice, as they are timing-sensitive and CI resource
# contention can cause tests to spuriously fail.
if set -qx CI
say yellow "Trying $i for a second time"
if not test_pexpect_file $i
set failed $failed $i
end
else
set failed $failed $i
end
end