Delay Gerrit events by 5s
When querying a change immediately after a patchset upload, Gerrit
may return incorrect data about dependent changes. In order to
avoid this, ensure at least 5 seconds have elapsed before delivering
any Gerrit events to Zuul.
Change-Id: I95c459f52562556ca1722878e32388d51033e86c
diff --git a/tests/base.py b/tests/base.py
index 08b3cab..cd87b24 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -396,7 +396,7 @@
return c
def addEvent(self, data):
- return self.event_queue.put(data)
+ return self.event_queue.put((time.time(), data))
def getEvent(self):
return self.event_queue.get()
@@ -479,6 +479,7 @@
def __init__(self, upstream_root, *args):
super(FakeGerritTrigger, self).__init__(*args)
self.upstream_root = upstream_root
+ self.gerrit_connector.delay = 0.0
def getGitUrl(self, project):
return os.path.join(self.upstream_root, project.name)