[autotest] Only warn if no hosts exist for a test if the pool is bvt.
This will greatly reduce the number of times that the warning will be
issued, reducing log spam. If any serious logic issues happen again that
would cause no tests to be scheduled again, the warning will still be
emitted.
BUG=chromium-os:32473
TEST=unit
STATUS=fixed
Change-Id: Ie294564171e06d3eea972fd54950994f630b334d
Reviewed-on: https://gerrit.chromium.org/gerrit/27194
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Ready: Alex Miller <milleral@chromium.org>
Tested-by: Alex Miller <milleral@chromium.org>
diff --git a/site_utils/suite_scheduler/task.py b/site_utils/suite_scheduler/task.py
index d790e74..64392e6 100644
--- a/site_utils/suite_scheduler/task.py
+++ b/site_utils/suite_scheduler/task.py
@@ -220,6 +220,17 @@
return scheduler.GetHosts(multiple_labels=labels)
+ def ShouldHaveAvailableHosts(self):
+ """As a sanity check, return true if we know for certain that
+ we should be able to schedule this test. If we claim this test
+ should be able to run, and it ends up not being scheduled, then
+ a warning will be reported.
+
+ @return True if this test should be able to run, False otherwise.
+ """
+ return self._pool == 'bvt'
+
+
def Run(self, scheduler, branch_builds, board, force=False):
"""Run this task. Returns False if it should be destroyed.