Repository navigation
test: pin the queue run timeout's comment and run limit more tightly - #1070
Conversation
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
Follow-up to #1011 review. The contract test now also requires the doc to give the run limit in hours next to its seconds (3 h (10800 s), and ties the workflow comment to timeout-minutes exactly: the 30 min, a margin derived from timeout-minutes less the two limits and 30 min, and the total, in the lines right above the timeout-minutes line. Signed-off-by: Tomas Saaristola <tsaarist@amd.com>
36712de to
4161d84
Compare
juhovainio
left a comment
There was a problem hiding this comment.
Looks good. This is a test-only change in xtask/src/workflow_contract.rs and it matches the PR description: the run limit is now asserted in hours, the tail of the workflow comment is pinned exactly, and the margin is derived from timeout-minutes. I didn't find any issues.
One optional note: the exact-text pin of the workflow comment assumes 4-space indentation and LF line endings, so a CRLF checkout of the workflow file would fail it (the other assertions are substring checks and wouldn't). Not worth blocking on.
This reflects a read of the diff only; I did not build or re-run the tests.
juhovainio
left a comment
There was a problem hiding this comment.
Independent re-review of the current head (4161d84), test-only change to xtask/src/workflow_contract.rs.
Verified by hand and with two independent passes:
- The new run-limit assertion (
flat.contains("{run_text} ({run_secs} s")) matchesdocs/nightly-on-the-queue.md's "...run for up to 3 h (10800 s..." exactly. - The exact-text pin of the workflow comment's last three lines (the 30-min line, the margin line,
timeout-minutes:) matches.github/workflows/queue-run.ymlbyte-for-byte, including its 4-space indentation (confirmed withcat -A). margin_minutes = timeout_minutes - (wait_secs+run_secs)/60 - 30cannot underflow: the pre-existingtimeout_minutes*60 >= wait_secs+run_secs+30*60assertion and the new(wait_secs+run_secs) % 60 == 0assertion both run first and together guarantee the subtraction stays non-negative.- With the current numbers (wait 15000 s, run 10800 s, timeout 480 min) the derived margin is 20, matching the comment's literal "20 min are margin" — so the test is not a tautology, it's actually pinned to real content.
- PR description accurately scopes the change (test-only, no workflow/doc edit) and matches the diff (single file, 21/-3).
I agree with juhovainio's existing approval and its one optional note (the exact-text pin assumes LF + 4-space indentation, so a CRLF checkout would fail it while the other, substring-only assertions wouldn't) — still accurate at this head, not blocking.
One tiny, non-blocking observation of my own: the new run-limit check is strictly stronger than the pre-existing separate ({run_secs} s check just above it, which is now redundant; the wait-limit assertions a few lines up weren't given the same combined-string tightening, so the two limits end up checked with slightly asymmetric strictness. Not a defect and not worth a follow-up on its own.
CI is green on the current head (build/test/clippy/lint/security scans/E2E all passing); the one non-completed job, E2E tests (MI300X, current), is queued behind the self-hosted runner backlog per the author's own comment and isn't a required-check failure.
No blocking findings.
🤖 Automated by an AI agent
What
Tighten two assertions in
the_queue_run_timeout_covers_the_wait_and_run_limits_the_doc_gives, as juhovainio asked on #1011 (threads onworkflow_contract.rs):3 h (10800 s), as the wait limit already is;timeout-minutes: the 30 min, the margin and the total. The margin is derived fromtimeout-minutesless the two limits and 30 min, so it cannot drift from the number.Test only; no workflow or doc change.
Test
cargo test -p xtask workflow_contractpasses (158 tests). Checked that the test fails with the comment's margin set to 15 min, and with the doc's "3 h" changed to "4 h".