Skip to content

Commit e1b31ed

Browse files
Fix failing impact scheduler tests (#3974)
1 parent 3b1d4b4 commit e1b31ed

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/clusterfuzz/_internal/tests/appengine/handlers/cron/recurring_tasks_test.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,27 @@ def test_execute(self):
9797

9898

9999
class ImpactTasksSchedulerTest(OpenReproducibleTestcaseTasksSchedulerTest):
100-
"""Tests ProgressionTasksScheduler."""
100+
"""Tests schedule_impact_tasks."""
101101

102102
def setUp(self):
103103
super().setUp()
104104
helpers.patch(self, [
105105
'clusterfuzz._internal.base.tasks.add_task',
106+
'clusterfuzz._internal.base.utils.is_chromium',
106107
])
108+
helpers.patch_environ(self)
107109

108-
def test_execute(self):
109-
"""Tests scheduling of progression tasks."""
110+
def test_chromium(self):
111+
"""Tests scheduling of impact tasks in chrome."""
112+
self.mock.is_chromium.return_value = True
110113
schedule_impact_tasks.main()
111114
self.mock.add_task.assert_has_calls([
112115
mock.call('impact', 1, 'job', queue='jobs-linux'),
113116
mock.call('impact', 5, 'job_windows', queue='jobs-windows'),
114117
])
118+
119+
def test_nonchromium(self):
120+
"""Tests there is no scheduling of impact tasks outside of chromium."""
121+
self.mock.is_chromium.return_value = False
122+
schedule_impact_tasks.main()
123+
self.mock.add_task.assert_not_called()

0 commit comments

Comments
 (0)