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

flaky console test #1543

Closed qweeah closed 3 days ago

qweeah commented 1 week ago

What happened in your environment?

Sometimes when running the unit test, the console test might fail unexpectedly with error

> go test -count=20 ./...                                           
...
ok      oras.land/oras/cmd/oras/internal/display/status 0.080s
--- FAIL: TestConsole_OutputTo (0.00s)
    console_test.go:112: OutputTo output error: failed to find "^[8^[[1Ftest string^[[0m\r\n^[[0K" in ""
FAIL
FAIL    oras.land/oras/cmd/oras/internal/display/status/console 0.073s
ok  

What did you expect to happen?

The test should pass

How can we reproduce it?

Run all unit tests with high repetition count, e.g. 20, and it's likely to happen

go test -count=20 ./...            

What is the version of your ORAS CLI?

Main branch build in 5280c67fcef9e1029d539aef03370a31e5df839a

What is your OS environment?

Ubuntu 24.04

Are you willing to submit PRs to fix it?