diff --git a/benchmark/gui/TGUI46_job_failure_triage_workmail_sms_notes/fixtures/scheduler/jobs.json b/benchmark/gui/TGUI46_job_failure_triage_workmail_sms_notes/fixtures/scheduler/jobs.json index 2977f61..3e08444 100644 --- a/benchmark/gui/TGUI46_job_failure_triage_workmail_sms_notes/fixtures/scheduler/jobs.json +++ b/benchmark/gui/TGUI46_job_failure_triage_workmail_sms_notes/fixtures/scheduler/jobs.json @@ -192,13 +192,13 @@ ] }, { - "job_id": "JOB-705", + "job_id": "JOB-712", "name": "db_migration_user_preferences", - "description": "Database migration to add user preferences schema for rate-limiting feature", - "cron_expression": "", + "description": "One-time database migration to add user preferences schema for rate-limiting feature", + "cron_expression": "30 2 * * *", "enabled": true, - "last_status": "running", - "last_run": "2026-04-02T17:30:00+08:00", + "last_status": "success", + "last_run": "2026-04-02T02:30:00+08:00", "action": "run_db_migration", "created_by": "Lin Zhenkai", "tags": [ @@ -206,13 +206,25 @@ "migration", "rate-limiting" ], - "notes": "Migration started at 17:30, estimated completion 20:00. Conflicts with proposed deployment window. Holds exclusive lock on user_accounts table.", + "notes": "Accidentally left enabled after the one-time migration on 2026-03-30. Runs at 02:30 and holds 15+ database connections for 45-60 minutes, overlapping with nightly_cache_warmup at 03:00.", "execution_history": [ { - "run_time": "2026-04-02T17:30:00+08:00", - "status": "running", - "duration_seconds": 4500, - "notes": "Migration in progress - processing 2.3M rows, 45% complete" + "run_time": "2026-03-31T02:30:00+08:00", + "status": "success", + "duration_seconds": 3420, + "notes": "Migration job held 18 database connections while nightly_cache_warmup started at 03:00." + }, + { + "run_time": "2026-04-01T02:30:00+08:00", + "status": "success", + "duration_seconds": 3510, + "notes": "Migration job overlapped with cache warmup window and saturated the connection pool." + }, + { + "run_time": "2026-04-02T02:30:00+08:00", + "status": "success", + "duration_seconds": 3380, + "notes": "Migration job overlapped with nightly_cache_warmup; pool size 20, active connections peaked at 20." } ] }, @@ -398,7 +410,7 @@ ] }, { - "job_id": "JOB-712", + "job_id": "JOB-727", "name": "weekly_cache_warmup", "description": "Weekly Redis cache pre-population for frequently accessed user data", "cron_expression": "0 4 * * 0", @@ -869,4 +881,4 @@ } ] } -] \ No newline at end of file +] diff --git a/tests/test_service_schema_drift.py b/tests/test_service_schema_drift.py index 0093767..98bc219 100644 --- a/tests/test_service_schema_drift.py +++ b/tests/test_service_schema_drift.py @@ -17,6 +17,7 @@ import importlib import json import os +from pathlib import Path from fastapi.testclient import TestClient @@ -191,6 +192,21 @@ def test_scheduler_next_run_backfilled(tmp_path): assert jobs["JOB-2"]["next_run"] == "2026-06-15T02:00:00" +def test_tgui46_scheduler_fixture_matches_reference_ground_truth(): + fixture = ( + Path(__file__).resolve().parents[1] + / "benchmark/gui/TGUI46_job_failure_triage_workmail_sms_notes" + / "fixtures/scheduler/jobs.json" + ) + jobs = json.loads(fixture.read_text(encoding="utf-8")) + by_id = {job["job_id"]: job for job in jobs} + + assert by_id["JOB-712"]["name"] == "db_migration_user_preferences" + assert by_id["JOB-712"]["enabled"] is True + assert "02:30" in by_id["JOB-712"]["notes"] + assert by_id["JOB-725"]["name"] == "nightly_cache_warmup" + + def test_scheduler_cron_parser_units(): SC = importlib.import_module("mock_services.scheduler.server") assert SC._parse_cron_field("*", 0, 59) == set(range(60))