fix tc ordering

This commit is contained in:
2026-07-23 14:57:43 -04:00
parent 23ae3a2f3a
commit f2d2a6c2e7
3 changed files with 17 additions and 14 deletions
+9 -6
View File
@@ -31,7 +31,8 @@ class ScheduleWindow:
class Scheduler:
def __init__(
self,
tests: list[Test],
all_tests: list[Test],
schedulable_tests: list[Test],
top_priority_tests: set[tuple[str, str]],
start_date: str | None = None,
holiday_dates: set[str] = set(),
@@ -40,10 +41,11 @@ class Scheduler:
dual_device_window_start_dates: set[str] | None = None,
priority_weight: int = 1000,
):
self.all_tests = all_tests
self.schedulable_tests = schedulable_tests
self.top_priority_tests = top_priority_tests
self.tests = tests
self.active_dut: dict[str, Test] = {test.test_id: test for test in tests if test.device == DUT}
self.active_ref: dict[str, Test] = {test.test_id: test for test in tests if test.device == REF}
self.active_dut: dict[str, Test] = {test.test_id: test for test in schedulable_tests if test.device == DUT}
self.active_ref: dict[str, Test] = {test.test_id: test for test in schedulable_tests if test.device == REF}
self.start_date = date.fromisoformat(start_date) if start_date else date.today()
self.holiday_dates = holiday_dates
self.daytime_testing_today = daytime_testing_today
@@ -75,13 +77,14 @@ class Scheduler:
window_index = 0
cursor_date = self.start_date
tc_order = self.get_tc_order(self.tests)
tc_order = self.get_tc_order(self.all_tests)
for tc in tc_order:
tc_bundles = all_bundles_by_tc[tc]
if tc_bundles is None or len(tc_bundles) == 0:
print(f"[scheduler] No bundles found for TC: {tc}. Skipping to next TC.")
continue
print(f"[scheduler] Scheduling bundles for TC: {tc} with {len(tc_bundles)} bundles.")
window_device = DUT
pending_dut: list[TestBundle] = []
pending_ref: list[TestBundle] = []