From 3913b2815360d02db47a85127d60734f66250b57 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 25 Oct 2022 13:32:34 -0500 Subject: [PATCH] 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. --- tests/interactive.fish | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/interactive.fish b/tests/interactive.fish index 27f86f6c8..9f2e0d63f 100644 --- a/tests/interactive.fish +++ b/tests/interactive.fish @@ -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