Repository navigation
Conversation
test_run_timeout_during_metrics_drain_interrupts used a 2.5s wall-clock run_timeout_s, but the deadline starts before service launch (~2.4-3.2s). In CI the watchdog usually fired during startup, SIGTERMing the metrics aggregator before its handler was installed, so no final_snapshot.json was written. Green runs aborted during HTTP client setup instead, so the post-ENDED drain window was never exercised. Fire the real RunWatchdog._fire path at the drain's first suspension via a timer-less watchdog subclass, gated on the run not having cancelled the watchdog yet. Assert the documented run-outcome precedence: the summary is interrupted / complete=False, while the aggregator's snapshot reads complete with no pending tokenizations (the ENDED event already went out without the INTERRUPTED marker). Also assert the fire reaches the drain as an abort. Closes mlcommons#553 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Makes
test_run_timeout_during_metrics_drain_interruptsdeterministic. It is a test-only change and touches no product code.Root cause.
run_benchmarkcomputes the run deadline before services launch. Service startup takes about 2.4–3.2 s, longer than the test's 2.5 srun_timeout_s.task.cancel()→MetricsPipeline.start→terminate_allSIGTERM, which arrives before the aggregator installs its handlerfinal_snapshot.json→aggregator must still write a final snapshot_kill_servicesSIGTERM → the aggregator's handlerinterruptedsnapshot, but the drain path was never exercisedWhat changed
RunWatchdogsubclass queues the real_fireat the drain's first suspension. It only fires if the run hasn't calledwatchdog.cancel(), so the test still checks that the watchdog stays armed through the drain.test_sigint_in_drain_window_keeps_summary_authoritative):Run timeout .*report marked INTERRUPTED;abort_eventset);result_summary.jsonreadsstate=interruptedwithcomplete: false;final_snapshot.jsonreadsstate=completewithn_pending_tasks == 0, because ENDED had already gone out without the INTERRUPTED marker.interrupted_teardown_grace_s=120leaves room for the drain to finish.Out of scope (separate follow-ups):
test_run_timeout_produces_interrupted_reporthas a 6 s budget, which is close to startup time.Type of change
Related issues
Closes #553
Testing
watchdog.cancel()before the drainDID NOT RAISE)abort_event.set()in_fire[False] == [True])tests/integration/commands/test_run_timeout.pyLinux CI (affinity on,
--cov) is still pending.Checklist
sched_*affinityerrors insrc/)🤖 Generated with Claude Code