Fix race in test_queue_rate_limiting_dependent
The simultaneous release of two merge jobs each with two dependent
jobs could result in the 4 dependent jobs arriving in AABB order
rather than the expected ABAB order. Wait between releases of
the merge jobs to ensure the expected order.
The orderedRelease method is updated to facilitate this.
Change-Id: Ibe5435e43a88ce2dd93bca96e221d91b8779f1f8
diff --git a/tests/base.py b/tests/base.py
index 3d2f4c1..16332bf 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1642,11 +1642,15 @@
commit = repo.index.commit('Creating a fake commit')
return commit.hexsha
- def orderedRelease(self):
+ def orderedRelease(self, count=None):
# Run one build at a time to ensure non-race order:
+ i = 0
while len(self.builds):
self.release(self.builds[0])
self.waitUntilSettled()
+ i += 1
+ if count is not None and i >= count:
+ break
def release(self, job):
if isinstance(job, FakeBuild):