Skip to content

fix(progress): floor ETA remaining at 0 so retry double-counts don't show negative time#102

Open
gadievron wants to merge 1 commit into
masterfrom
fix/progress-floor-eta-remaining-at-0-so-retry
Open

fix(progress): floor ETA remaining at 0 so retry double-counts don't show negative time#102
gadievron wants to merge 1 commit into
masterfrom
fix/progress-floor-eta-remaining-at-0-so-retry

Conversation

@gadievron
Copy link
Copy Markdown
Collaborator

ProgressReporter.report() does an unconditional self.completed += 1, so a retried unit
re-reports and completed can exceed total. _estimate_remaining then computed
remaining_units = self.total - self.completed < 0, rendering the ETA as a negative
duration (e.g. "ETA ~-30s"). Floor it at max(0, ...).

Tests: tests/test_progress_eta_no_underflow.py (2 cases). RED 1 failed -> GREEN 2 passed;
full suite 178 passed / 63 skipped (py3.11).

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…show negative time

ProgressReporter.report() does an unconditional `self.completed += 1`, so a retried unit
re-reports and `completed` can exceed `total`. _estimate_remaining then computed
`remaining_units = self.total - self.completed` < 0, rendering the ETA as a negative
duration (e.g. "ETA ~-30s"). Floor it at max(0, ...).

Tests: tests/test_progress_eta_no_underflow.py (2 cases). RED 1 failed -> GREEN 2 passed;
full suite 178 passed / 63 skipped (py3.11).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant