Browse Source

Sequence builds in test_executor

These assertions assume the builds are in a specific order.  To
ensure that, wait for each build to pause before starting the next.

Change-Id: I2e62a0197b833e36522aac14dc8f4d4f386eccf5
changes/28/743628/1
James E. Blair 7 months ago
parent
commit
5804c4c293
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      tests/unit/test_executor.py

+ 6
- 3
tests/unit/test_executor.py View File

@ -106,8 +106,8 @@ class TestExecutorRepos(ZuulTestCase):
A.addApproval('Code-Review', 2)
B.addApproval('Code-Review', 2)
self.fake_gerrit.addEvent(A.addApproval('Approved', 1))
self.waitUntilSettled()
self.fake_gerrit.addEvent(B.addApproval('Approved', 1))
self.waitUntilSettled()
self.assertEqual(2, len(self.builds), "Two builds are running")
@ -145,9 +145,10 @@ class TestExecutorRepos(ZuulTestCase):
B.addApproval('Code-Review', 2)
C.addApproval('Code-Review', 2)
self.fake_gerrit.addEvent(A.addApproval('Approved', 1))
self.waitUntilSettled()
self.fake_gerrit.addEvent(B.addApproval('Approved', 1))
self.waitUntilSettled()
self.fake_gerrit.addEvent(C.addApproval('Approved', 1))
self.waitUntilSettled()
self.assertEqual(3, len(self.builds), "Three builds are running")
@ -205,10 +206,12 @@ class TestExecutorRepos(ZuulTestCase):
C.addApproval('Code-Review', 2)
D.addApproval('Code-Review', 2)
self.fake_gerrit.addEvent(A.addApproval('Approved', 1))
self.waitUntilSettled()
self.fake_gerrit.addEvent(B.addApproval('Approved', 1))
self.waitUntilSettled()
self.fake_gerrit.addEvent(C.addApproval('Approved', 1))
self.waitUntilSettled()
self.fake_gerrit.addEvent(D.addApproval('Approved', 1))
self.waitUntilSettled()
self.assertEqual(4, len(self.builds), "Four builds are running")


Loading…
Cancel
Save