Skip to content

fix: serialize progress console frames - #2292

Merged
TerryHowe merged 2 commits into
oras-project:mainfrom
kocaemre:fix/serialize-progress-render
Oct 24, 2026
Merged

TerryHowe merged 2 commits into
oras-project:mainfrom
kocaemre:fix/serialize-progress-render

Conversation

@kocaemre

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Serializes manager.render() across the ticker and Track paths so one console frame finishes before another begins. The existing manager read lock protects status from writes but permits simultaneous renders and interleaved terminal cursor operations. A blocking-console regression exercises two concurrent renders without changing console or status behavior. AI-assisted implementation and test, locally verified.

Which issue(s) this PR fixes:
Fixes #2291

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update? No; internal synchronization only.
  • Does this introduce breaking changes that would require an announcement or bumping the major version? No.
  • Do all new files have an appropriate license header? No new files; existing test file retains its header.

Verification (Docker golang:1.26.7, from repository root; GOMAXPROCS=4, go test -p 4):

  • RED: go test -p 4 ./cmd/oras/internal/display/status/progress -run '^Test_manager_render_serializes_console_frames$' -count=1 -v → FAIL: second render wrote before first frame finished.
  • GREEN: same focused test with -count=10 → 10 pass.
  • go test -race -p 4 ./cmd/oras/internal/display/status/progress/... -count=1 → both packages pass.
  • go vet -p 4 ./cmd/oras/internal/display/status/... and go test -p 4 ./cmd/oras/internal/display/status/... -count=1 → pass (five packages).
  • go test -p 4 ./... -count=1, gofmt -l on the two changed files (empty output), and git diff --check origin/main...HEAD → pass.

@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.93%. Comparing base (ecc3e87) to head (c71f688).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2292      +/-   ##
==========================================
+ Coverage   60.92%   60.93%   +0.01%     
==========================================
  Files         140      140              
  Lines        6098     6100       +2     
==========================================
+ Hits         3715     3717       +2     
  Misses       2163     2163              
  Partials      220      220              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kocaemre
kocaemre force-pushed the fix/serialize-progress-render branch from d818075 to c71f688 Compare October 24, 2026 10:59

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@TerryHowe
TerryHowe merged commit 81f1656 into oras-project:main Oct 24, 2026
10 checks passed
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.

bug: concurrent manager.render calls interleave console output

2 participants