Skip to content

fix: sub-minute job timeouts reported as 0 minutes (closes #9527) - #9578

Merged
koenvanderveen merged 4 commits into
OpenMined:devfrom
pranavvrao1-ai:fix/9527-subminute-timeout-display
Oct 26, 2026
Merged

koenvanderveen merged 4 commits into
OpenMined:devfrom
pranavvrao1-ai:fix/9527-subminute-timeout-display

Conversation

@pranavvrao1-ai

@pranavvrao1-ai pranavvrao1-ai commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #9527. Job timeouts shorter than 60 seconds were displayed as 0 minutes because integer division (timeout // 60) truncated the duration.

Changes

  • Added _format_timeout(seconds: int) in job_runner.py to format durations as hours, minutes, and seconds.
  • Replaced the three timeout // 60 log-message calculations in _execute_job_streaming, _execute_job_captured, and _run_approved_job with _format_timeout(timeout).
  • Added parametrized tests for zero, sub-minute, minute, and hour-based durations.
  • Added a regression test ensuring timeouts between 1 and 59 seconds are not reported as 0 minutes.

Testing

Run the targeted test suite:

cd packages/syft-job
pytest tests/test_job_runner_timeout.py -v

Record the test results here after running the command.

Related issue

Fixes #9527 — Sub-minute job timeouts are reported as zero minutes.

…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.
@koenvanderveen
koenvanderveen merged commit 7beb6ee into OpenMined:dev Oct 26, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sub-minute job timeouts are reported as zero minutes

2 participants