Repository navigation
fix: sub-minute job timeouts reported as 0 minutes (closes #9527) - #9578
Merged
koenvanderveen merged 4 commits intoOct 26, 2026
Merged
koenvanderveen merged 4 commits into
koenvanderveen merged 4 commits into
Conversation
…9527) When a job's timeout is less than 60 seconds, using integer division imeout // 60 produced 0, causing misleading messages like: 'Job foo timed out after 0 minutes' Introduce _format_timeout(seconds) that formats durations using hours, minutes, and seconds — falling back to seconds when the duration is sub-minute. Replace all three imeout // 60 uses in job_runner.py. Add parametrized tests covering sub-minute, minute-boundary, and multi-hour durations, plus a regression test that asserts '0 minutes' never appears for any timeout in [1, 59] seconds.
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.
Summary
Fixes #9527. Job timeouts shorter than 60 seconds were displayed as
0 minutesbecause integer division (timeout // 60) truncated the duration.Changes
_format_timeout(seconds: int)injob_runner.pyto format durations as hours, minutes, and seconds.timeout // 60log-message calculations in_execute_job_streaming,_execute_job_captured, and_run_approved_jobwith_format_timeout(timeout).0 minutes.Testing
Run the targeted test suite:
cd packages/syft-job pytest tests/test_job_runner_timeout.py -vRecord the test results here after running the command.
Related issue
Fixes #9527 — Sub-minute job timeouts are reported as zero minutes.