Bug #10880
closed[Tests] Fix flaky test test_callback (tests.test_events.PollClientTestCase)
Description
Example: https://ci.curoverse.com/job/run-tests-remainder/540/consoleFull
====================================================================== FAIL: test_callback (tests.test_events.PollClientTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/1/jenkins/workspace/run-tests-remainder/sdk/python/tests/test_events.py", line 340, in test_callback self.assertTrue(self.callback_called.wait(self.TEST_TIMEOUT)) AssertionError: False is not true ----------------------------------------------------------------------
Updated by Tom Clegg almost 8 years ago
- Category set to Tests
- Assigned To set to Tom Clegg
10880-poll-test-races at b97d14dbd377cc73854eefe77d6450859a41f6b7
copied from commit message:
The polling tests were broken because the API stub was returning its
fake events during the "find recent log ID" probe, so they were being
thrown away by PollClient and never sent to the test case's callback
function.
Most of the tests kept passing anyway, though, because subscribe()
itself sends a synthetic {'status':200} event, and this was being
misconstrued as confirmation that an event had been retrieved from the
API stub.
The false positive was not reliable for test_callback(), though,
because it cleared callback_called and tested another event without
calling subscribe() again. Sometimes, because the first "wait for
event" wasn't really waiting, the test would feed the second event to
the stub before PollClient had a chance to do its ID probe, so both
events would be dropped and the second "wait for event" would fail.
With the "wait for event" code fixed, it is no longer necessary to
close the poll client before checking which filters were used to
retrieve events.
Updated by Tom Clegg almost 8 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset arvados|commit:99b571c9050f28525427c100f9072159a3145bc7.