Repository navigation
fix: report sub-minute job timeouts in seconds - #9560
choksi2212 wants to merge 1 commit into
Conversation
All three job-runner timeout paths formatted the duration with integer division (timeout // 60), so a timeout configured below 60 seconds printed as "timed out after 0 minutes". Add a shared format_timeout_duration helper that reports sub-minute timeouts in seconds and keeps the minutes phrasing for a minute or longer, and use it at every timeout message site. Closes OpenMined#9527 Signed-off-by: choksi2212 <choksi2212@users.noreply.github.com>
|
Thanks for the review bandwidth in advance. The workflow runs on this PR are waiting on a maintainer approval since this is the first contribution from this fork — they can be approved from the PR's checks section or the Actions tab whenever someone has a moment. |
|
Both red checks look unrelated to this change and infra-side rather than code-side:
The suites that cover the change all pass: |
|
Both red checks on the latest head look like runner-side infra flakes rather than this change:
Everything in the unit-test matrix is green ( If someone with re-run permissions could retry the two failed jobs ( |
|
Hi — gentle nudge on this one when you have a moment. Sub-minute job timeouts printed as |
Summary
All three job-runner timeout messages formatted the configured duration with integer division (
timeout // 60), so any timeout below 60 seconds printed astimed out after 0 minutes(#9527). This PR reports sub-minute timeouts in seconds and keeps the existing minutes phrasing for durations of a minute or longer.Changes
format_timeout_duration(seconds)tosyft_job/job_runner.py:< 60renders asN second(s),>= 60renders asN minute(s)with correct singular/plural; the truncation for minute-plus values is unchanged (61swas already1 minutebefore, just with the wrong plural).timeout // 60expression at all three timeout message sites: the streaming loop (_execute_job_streaming), the captured runner (_execute_job_captured), and the runner-levelsubprocess.TimeoutExpiredhandler.Testing
packages/syft-job/tests/test_timeout_duration.py(8 tests):format_timeout_durationacross the sub-minute regime (1,30,59), the minute boundary (60,61,120,600), and singular/plural forms._execute_job_capturedand assert the printed message readstimed out after 1 secondand never0 minutes(the captured path runs the sameprintsite the streaming path uses; the streaming loop'sselectors-on-pipes behavior is not exercised on Windows, matching the existing suite which runs it on Linux CI).dev), a real 1-second timeout printsJob <name> timed out after 0 minutes— the exact symptom from the issue.Job <name> timed out after 1 second.packages/syft-jobtest suite: 134 passed, 11 failed with this change; 126 passed, the identical 11 failed on pristinedev(thetest_staging.pyreturncode-127 cluster, pre-existing and environment-dependent, untouched by this diff).ruff checkandruff format(v0.12.9, the pinned pre-commit rev) clean on both files.Asana task