Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ut): fix flaky console tests #1544

Merged
merged 3 commits into from
Nov 30, 2024

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Nov 25, 2024

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:

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

@qweeah qweeah marked this pull request as draft November 25, 2024 11:54
Signed-off-by: Billy Zha <[email protected]>
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

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

@qweeah qweeah changed the title fix(ut): close console file after reading finishes fix(ut): fix flacky console tests Nov 27, 2024
@qweeah qweeah changed the title fix(ut): fix flacky console tests fix(ut): fix flaky console tests Nov 27, 2024
@qweeah qweeah marked this pull request as ready for review November 27, 2024 12:53
Copy link
Member

@TerryHowe TerryHowe left a comment

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 0483d7b into oras-project:main Nov 30, 2024
8 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.

flaky console test
3 participants