Skip to content

Improve error handling in cli.StatusReaderConsoleAdapter and fix race condition with status.progress#48

Merged
kostrykin merged 7 commits intodevelopfrom
dev/cli-status-errors
Jun 3, 2025
Merged

Improve error handling in cli.StatusReaderConsoleAdapter and fix race condition with status.progress#48
kostrykin merged 7 commits intodevelopfrom
dev/cli-status-errors

Conversation

@kostrykin
Copy link
Owner

@kostrykin kostrykin commented Jun 3, 2025

  • Report the processed status file when errors occur in cli.StatusReaderConsoleAdapter
  • Fix race condition in cli.StatusReaderConsoleAdapter that occurred when using status.progress

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@kostrykin kostrykin changed the title Report the processed status file when errors occur in cli.StatusReaderConsoleAdapter Improve error handling in cli.StatusReaderConsoleAdapter and fix race condition with status.progress Jun 3, 2025
@github-actions
Copy link

github-actions bot commented Jun 3, 2025

Test coverage of 11be640: 94%

@kostrykin kostrykin marked this pull request as ready for review June 3, 2025 17:42
@kostrykin kostrykin requested a review from Copilot June 3, 2025 17:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the CLI status reader by reporting errors on processing status files, initializing and resetting a start‐time marker to fix a race condition in progress updates, and adds new tests to cover blocking and delayed‐start scenarios.

  • Report the filepath when full_format encounters an exception.
  • Introduce and manage _progress_t0 to ensure ETA calculations don’t race.
  • Rename test helper, and add test_blocking and test_delayed tests for progress behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/testsuite.py Rename CaptureStdout to CaptureOutput and add CaptureStdout subclass using create_redirect.
tests/test_cli.py Guard in asyncTearDown, plus new test_blocking and test_delayed cases for progress output.
repype/cli.py Add _progress_t0 field, catch exceptions in full_format, and refine progress timing/reset logic.
Comments suppressed due to low confidence (1)

tests/test_cli.py:197

  • The test_delayed method has no assertions after exercising the progress reader; add an explicit assertEqual or similar to verify the captured output matches expectations.
async def test_delayed(self):

@kostrykin kostrykin merged commit b600322 into develop Jun 3, 2025
7 checks passed
@kostrykin kostrykin deleted the dev/cli-status-errors branch June 3, 2025 17:50
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