mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-28 16:58:31 +01:00
Keep poll retirement Help verification aligned with the planner (#5365)
The planner now passes its cancellation context into provider reads. Check that it still discards a roster returned after cancellation, instead of failing Public docs on the old context-free call spelling. --- Fleet candidate `20261128T063745Z-core-runtime` from the `core-runtime` lane. Reviewed tip `851001c5c26ee15e9968e328c462c6fcee057254` on `main`. [How Pulse handles triage](https://github.com/rcourtman/Pulse/blob/main/docs/AI_TRANSPARENCY.md)
This commit is contained in:
@@ -141,8 +141,6 @@ class WatchdogHelpDocsTest(unittest.TestCase):
|
||||
"func (m *Monitor) planScheduledPolls(ctx context.Context, now time.Time)",
|
||||
"id := progress.beginPlanning(time.Now())",
|
||||
"defer progress.finishPlanning(id)",
|
||||
"descriptors := m.describeInstancesForScheduler()",
|
||||
"if ctx.Err() != nil {",
|
||||
"m.taskQueue.upsertPlan(task, revision)",
|
||||
"m.state.UpdatePollStats(",
|
||||
"m.syncAlertsToState()",
|
||||
@@ -150,6 +148,14 @@ class WatchdogHelpDocsTest(unittest.TestCase):
|
||||
with self.subTest(schedule_token=token):
|
||||
self.assertIn(token, schedule_src)
|
||||
|
||||
# The roster read uses the monitor context but can still return after
|
||||
# cancellation. Check that its result is discarded before publishing.
|
||||
self.assertRegex(
|
||||
schedule_src,
|
||||
r"descriptors := m\.describeInstancesForScheduler\(ctx\)\s*"
|
||||
r"(?://[^\n]*\n\s*)*if ctx\.Err\(\) != nil \{\s*return\s*\}",
|
||||
)
|
||||
|
||||
for token in (
|
||||
'"pulse_scheduler_poll_planning_age_seconds"',
|
||||
'"pulse_scheduler_claimed_poll_overdue_seconds"',
|
||||
|
||||
Reference in New Issue
Block a user