oras-project / oras

OCI registry client - managing content like artifacts, images, packages
https://oras.land
Apache License 2.0
1.52k stars 181 forks source link

fix(ut): fix flaky console tests #1544

Closed qweeah closed 3 days ago

qweeah commented 1 week ago

What this PR does / why we need it: This PR fixes flaky console unit tests. To reproduce the flaky tests, try

go test -count=1000 -run ^TestConsole_Save$ oras.land/oras/cmd/oras/internal/display/status/console

PTY output might be interrupted by unexpected error like console_test.go:134: Save output error: failed to find "^[[?25l^[7^[[0m" in ""

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #1543

Please check the following list:

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.96%. Comparing base (76eadf2) to head (10175f1). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1544 +/- ## ======================================= Coverage 83.96% 83.96% ======================================= Files 119 119 Lines 5306 5306 ======================================= Hits 4455 4455 Misses 604 604 Partials 247 247 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.