Skip to content

make test_run_cmd_async more robust against fluke failures#3908

Merged
branfosj merged 1 commit intoeasybuilders:developfrom
boegel:robust_test_run_cmd_async
Dec 4, 2021
Merged

make test_run_cmd_async more robust against fluke failures#3908
branfosj merged 1 commit intoeasybuilders:developfrom
boegel:robust_test_run_cmd_async

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Dec 4, 2021

Avoids fluke failure for this test:

FAIL: test_run_cmd_async (test.framework.run.RunTest)
Test asynchronously running of a shell command via run_cmd + complete_cmd.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/runner/4e4709f47e34a1f2fa3b0c9c80f56e62d9a300f1/lib/python3.5/site-packages/easybuild/base/testing.py", line 94, in assertEqual
    super(TestCase, self).assertEqual(a, b)
  File "/opt/hostedtoolcache/Python/3.5.10/x64/lib/python3.5/unittest/case.py", line 829, in assertEqual
    assertion_func(first, second, msg=msg)
AssertionError: {'exit_code': None, 'done': False, 'output': 'sleeping...\ntest123\n'} != {'exit_code': 0, 'done': True, 'output': 'sleeping...\ntest123\n'}
- {'done': False, 'exit_code': None, 'output': 'sleeping...\ntest123\n'}
?          ^^^^                ^^^^

+ {'done': True, 'exit_code': 0, 'output': 'sleeping...\ntest123\n'}
?          ^^^                ^


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/runner/4e4709f47e34a1f2fa3b0c9c80f56e62d9a300f1/lib/python3.5/site-packages/test/framework/run.py", line 609, in test_run_cmd_async
    self.assertEqual(res, {'done': True, 'exit_code': 0, 'output': 'sleeping...\ntest123\n'})
  File "/tmp/runner/4e4709f47e34a1f2fa3b0c9c80f56e62d9a300f1/lib/python3.5/site-packages/easybuild/base/testing.py", line 116, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: {'exit_code': None, 'done': False, 'output': 'sleeping...\ntest123\n'} != {'exit_code': 0, 'done': True, 'output': 'sleeping...\ntest123\n'}
- {'done': False, 'exit_code': None, 'output': 'sleeping...\ntest123\n'}
?          ^^^^                ^^^^

+ {'done': True, 'exit_code': 0, 'output': 'sleeping...\ntest123\n'}
?          ^^^                ^
:
DIFF:
- {'done': False, 'exit_code': None, 'output': 'sleeping...\ntest123\n'}?          ^^^^                ^^^^
+ {'done': True, 'exit_code': 0, 'output': 'sleeping...\ntest123\n'}

----------------------------------------------------------------------
Ran 803 tests in 871.266s

FAILED (failures=1)
ERROR: Not all tests were successful.

@boegel boegel added the bug fix label Dec 4, 2021
@boegel boegel added this to the next release (4.5.1?) milestone Dec 4, 2021
@boegel boegel requested a review from branfosj December 4, 2021 10:06
Copy link
Copy Markdown
Member

@branfosj branfosj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@branfosj branfosj enabled auto-merge December 4, 2021 10:27
@branfosj branfosj merged commit d0d6d1a into easybuilders:develop Dec 4, 2021
@boegel boegel deleted the robust_test_run_cmd_async branch December 4, 2021 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants