diff options
author | James E. Blair <jeblair@redhat.com> | 2019-09-23 11:42:32 -0400 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2019-09-23 11:42:32 -0400 |
commit | 723887ff1a55c0f11ea915dad44a373e24fa6ef6 (patch) | |
tree | 1c8c1b66d600f9e578609baa61c0a55f2a62e1ae | |
parent | 80ef01534d90751aa2d9cd3bf4a356fca292bed8 (diff) | |
download | zuul-723887ff1a55c0f11ea915dad44a373e24fa6ef6.tar.gz |
Wait for poll twice in tests
This is a crude fix to the race condition we're observing in
the gerrit checks tests. In that case, the following sequence
happens:
* poll starts, queries gate
* gate check entry is added
* wait for poll
* poll queries check
* poll finishes
In this case, since we started waiting for the poll after the
query we're interested in ran, we miss the event. To avoid this,
ensure that the poll fires twice before returning.
Change-Id: Ie8bad951a18f98b474df65e8a0efe1d7c2d6d695
-rw-r--r-- | tests/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/base.py b/tests/base.py index 582afe601..a07177ac4 100644 --- a/tests/base.py +++ b/tests/base.py @@ -3953,7 +3953,10 @@ class ZuulTestCase(BaseTestCase): def waitForPoll(self, poller, timeout=30): self.log.debug("Wait for poll on %s", poller) self.poller_events[poller].clear() - self.log.debug("Waiting for poll on %s", poller) + self.log.debug("Waiting for poll 1 on %s", poller) + self.poller_events[poller].wait(timeout) + self.poller_events[poller].clear() + self.log.debug("Waiting for poll 2 on %s", poller) self.poller_events[poller].wait(timeout) self.log.debug("Done waiting for poll on %s", poller) |