From 83ac761d8159596b67f10b98f8aacf0aeb4ffbb5 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 21 Jul 2017 14:37:44 -0400 Subject: [PATCH] fix a unit test that periodically fails if you run this test *a lot*, it fails - seemingly due to a bug in pexpect itself and how it handles stdout buffering; introducing a bit of latency seems to make the issue go away see: #7171 --- awx/main/tests/unit/isolated/test_expect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/tests/unit/isolated/test_expect.py b/awx/main/tests/unit/isolated/test_expect.py index 5b8c4aac27..8c3116896f 100644 --- a/awx/main/tests/unit/isolated/test_expect.py +++ b/awx/main/tests/unit/isolated/test_expect.py @@ -89,7 +89,7 @@ def test_password_prompt(): expect_passwords = OrderedDict() expect_passwords[re.compile(r'Password:\s*?$', re.M)] = 'secret123' status, rc = run.run_pexpect( - ['python', '-c', 'print raw_input("Password: ")'], + ['python', '-c', 'import time; print raw_input("Password: "); time.sleep(.05)'], HERE, {}, stdout,