Skip to content

Commit

Permalink
increase the timeout default for the success test to fix flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Apr 28, 2019
1 parent c2f39ad commit 9d294f8
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -20,10 +20,15 @@
class PytestRunIntegrationTest(PantsRunIntegrationTest):
testproject = 'testprojects/src/python/interpreter_selection'

# NB: Occasionally running a test in CI may take multiple seconds. The tests in this file which
# use the --timeout-default argument are not testing for performance regressions, but just for
# correctness of timeout behavior, so we set this to a higher value to avoid flakiness.
_non_flaky_timeout_seconds = 5

def test_pytest_run_timeout_succeeds(self):
pants_run = self.run_pants(['clean-all',
'test.pytest',
'--timeout-default=2',
'--timeout-default={}'.format(self._non_flaky_timeout_seconds),
'testprojects/tests/python/pants/timeout:exceeds_timeout',
'--',
'-kwithin_timeout'])
Expand Down Expand Up @@ -62,7 +67,7 @@ def test_pytest_run_timeout_cant_terminate(self):
pants_run = self.run_pants(['clean-all',
'test.pytest',
'--timeout-terminate-wait=2',
'--timeout-default=5',
'--timeout-default={}'.format(self._non_flaky_timeout_seconds),
'--coverage=auto',
'--cache-ignore',
'testprojects/tests/python/pants/timeout:ignores_terminate'])
Expand All @@ -87,7 +92,7 @@ def test_pytest_run_killed_by_signal(self):
pants_run = self.run_pants(['clean-all',
'test.pytest',
'--timeout-terminate-wait=2',
'--timeout-default=5',
'--timeout-default={}'.format(self._non_flaky_timeout_seconds),
'--cache-ignore',
'testprojects/tests/python/pants/timeout:terminates_self'])
end = time.time()
Expand Down

0 comments on commit 9d294f8

Please sign in to comment.