summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Westphahl <simon.westphahl@bmw.de>2022-07-04 09:48:57 +0200
committerSimon Westphahl <simon.westphahl@bmw.de>2022-07-04 15:59:58 +0200
commit41a4b8073048dcb66bb496dd3c466c3f1ede14c8 (patch)
treeb1025c69c91a239a6ab9293d0d3fdf572d4a5fe3 /tests
parent78953e9580120ecfe9c921bdb3f5ed9ce2936171 (diff)
downloadzuul-41a4b8073048dcb66bb496dd3c466c3f1ede14c8.tar.gz
Fix flaky zuul-web tests using cached tenant list
Disable caching for the remaining zuul-web tests that use the tenant list. Change-Id: I03c80a2171ee02fba41319b21f78003e4c8554b4
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_web.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py
index de4835565..5d38c5b19 100644
--- a/tests/unit/test_web.py
+++ b/tests/unit/test_web.py
@@ -260,6 +260,8 @@ class TestWeb(BaseTestWeb):
def test_web_tenants(self):
"Test that we can retrieve JSON status info"
+ # Disable tenant list caching
+ self.web.web.api.cache_expiry = 0
self.add_base_changes()
self.executor_server.hold_jobs_in_build = True
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
@@ -1383,6 +1385,14 @@ class TestEmptyConfig(BaseTestWeb):
'config/empty-config/git/common-config/new-zuul.yaml')
self.scheds.execute(lambda app: app.sched.reconfigure(app.config))
self.waitUntilSettled()
+
+ layout_scheduler = self.scheds.first.sched.local_layout_state.get(
+ 'tenant-one')
+ for _ in iterate_timeout(10, "local layout of zuul-web to be updated"):
+ layout_web = self.web.web.local_layout_state.get('tenant-one')
+ if layout_web == layout_scheduler:
+ break
+
resp = self.get_url("api/tenant/tenant-one/jobs").json()
self.assertEqual(len(resp), 3)