Fix race in test_in_repo_branch

We've told zuul about a new branch, so it's going to go look for
configuration in it, but while that's happening, we're adding a
new change upstream.  Adding the change will alter the upstream
repo sufficiently that queries to the fake gerrit to ask about
refs are likely to be affected by the process of adding the change.

To correct, wait for the system to stabilize after adding the branch
and before adding the new change.

Change-Id: Ie3e2e9b5ad35ba99c32261ab8e9b6265a95b7cde
This commit is contained in:
James E. Blair 2017-09-26 16:34:11 -07:00
parent 4dddb34aab
commit 6069f2bdab
1 changed files with 1 additions and 0 deletions

View File

@ -399,6 +399,7 @@ class TestInRepoConfig(ZuulTestCase):
self.fake_gerrit.addEvent(
self.fake_gerrit.getFakeBranchCreatedEvent(
'org/project', 'stable'))
self.waitUntilSettled()
A = self.fake_gerrit.addFakeChange('org/project', 'stable', 'A',
files=file_dict)
A.addApproval('Code-Review', 2)