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 test failures by flushing output streams before exiting Zebra #2911

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Oct 20, 2021

Motivation

I think that macOS might be dropping log output when the process exits, so our tests fail.
I've seen similar test errors on macOS before.

This is unexpected work in sprint 21.

Solution

  • flush stdout and stderr streams before exiting Zebra

Review

Anyone can review.

This is urgent, because CI is still failing.

Reviewer Checklist

  • Existing tests pass on all platforms

Next Steps

  • Try sending an empty line before the flush
  • Disable these tests on macOS CI

@teor2345 teor2345 added C-bug Category: This is a bug P-High I-integration-fail Continuous integration fails, including build and test failures labels Oct 20, 2021
@teor2345 teor2345 added this to the 2021 Sprint 21 milestone Oct 20, 2021
@teor2345 teor2345 requested a review from a team October 20, 2021 04:47
@teor2345 teor2345 self-assigned this Oct 20, 2021
@teor2345 teor2345 changed the title Try flushing streams before exiting Zebra Flush streams before exiting Zebra to fix test failures Oct 20, 2021
@teor2345 teor2345 changed the title Flush streams before exiting Zebra to fix test failures Fix test failures by flushing output streams before exiting Zebra Oct 20, 2021
@teor2345 teor2345 enabled auto-merge (squash) October 20, 2021 04:58
@teor2345 teor2345 merged commit e277975 into main Oct 20, 2021
@teor2345 teor2345 deleted the flush-stdout branch October 20, 2021 13:57
Comment on lines +497 to +498
// Some OSes require a flush to send all output to the terminal.
// Zebra's logging doesn't depend on `tokio`, so we flush the stdlib sync streams.
Copy link
Contributor

Choose a reason for hiding this comment

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

😭💀

Comment on lines +419 to +420
let _ = stdout().lock().flush();
let _ = stderr().lock().flush();
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug I-integration-fail Continuous integration fails, including build and test failures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants