Skip to content

Commit 2b00e5e

Browse files
committed
Add retries to test_repl
1 parent 077fe7e commit 2b00e5e

File tree

1 file changed

+16
-0
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests

1 file changed

+16
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_repl.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,23 @@
5050
import termios
5151
from textwrap import dedent
5252

53+
# The terminal tests can be flaky
54+
def autoretry(fn):
55+
def decorated(*args, **kwargs):
56+
retries = 3
57+
while retries:
58+
try:
59+
fn(*args, **kwargs)
60+
return
61+
except Exception:
62+
retries -= 1
63+
print("Retrying test")
64+
continue
65+
fn(*args, **kwargs)
66+
return decorated
5367

68+
69+
@autoretry
5470
def validate_repl(stdin, python_args=(), ignore_preamble=True):
5571
env = os.environ.copy()
5672
env['TERM'] = 'ansi'

0 commit comments

Comments
 (0)