-
Notifications
You must be signed in to change notification settings - Fork 403
Open
Description
Steps to reproduce the issue:
- Submit a PR
- Sometimes the CI build fails
What actually happened?:
Test case fails despite no changes to relevant code. See https://github.com/dotnet/Docker.DotNet/pull/496/checks?check_run_id=1992119140 for an example.
What did you expect to happen?:
Test case passes.
Additional information:
I see that this is a known bug in the test case. "// On CI/CD Pipeline exception is thrown, not always"
I think there's more of a problem here than I'm willing to fix:
- It looks like the event streams are delayed. Some of the events from CreateImageAsync don't arrive until after MonitorEventsAsync starts, so they show up in _onJSONMessageCalled. Some of the events from TagImageAsync don't arrive until after the assertion.
- I can't be sure that that's what's happening, since stdio might be buffered too. Adding some Console.Out.Flush and Console.Error.Flush calls between commands can help check for that.
- This probably isn't what's going wrong in this case, but it's a bug anyway: Using MonitorEventsAsync this way has a race condition. Unless you
awaitMonitorEventsAsync's Task, you can't guarantee that the monitoring has started, so you can miss messages. The fix would is to replace MonitorEventsAsync with something like StartEventMonitorAsync that returns a subscription.
Metadata
Metadata
Assignees
Labels
No labels