summaryrefslogtreecommitdiff
path: root/tests/unit/test_scheduler.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-08-15 22:59:09 +0000
committerGerrit Code Review <review@openstack.org>2022-08-15 22:59:09 +0000
commitafebbb6a6caae95c5edf56333a191d9c525d4c1d (patch)
tree3cd0704250412fbae7bc549cf8b0c32b82ac18a1 /tests/unit/test_scheduler.py
parentbb1b0d5c1108b2b4d21559535e9c120b732e99b2 (diff)
parentd61b9772ff6c5af57d93414bdc0f1a9d62ae35b4 (diff)
downloadzuul-afebbb6a6caae95c5edf56333a191d9c525d4c1d.tar.gz
Merge "Fix zoned executor metric when unzoned is allowed"
Diffstat (limited to 'tests/unit/test_scheduler.py')
-rw-r--r--tests/unit/test_scheduler.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index 5e0385be3..66c508fea 100644
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -226,6 +226,18 @@ class TestSchedulerZoneFallback(ZuulTestCase):
def test_jobs_executed(self):
"Test that jobs are executed and a change is merged per zone"
self.hold_jobs_in_queue = True
+
+ # Validate that the reported executor stats are correct. Since
+ # the executor accepts zoned and unzoned job it should be counted
+ # in both metrics.
+ self.assertReportedStat(
+ 'zuul.executors.online', value='1', kind='g')
+ self.assertReportedStat(
+ 'zuul.executors.unzoned.online', value='1', kind='g')
+ self.assertReportedStat(
+ 'zuul.executors.zone.test-provider_vpn.online',
+ value='1', kind='g')
+
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
A.addApproval('Code-Review', 2)
self.fake_gerrit.addEvent(A.addApproval('Approved', 1))