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

Refactor tests that mutate the global log object #112

Closed
lucianjon opened this issue Nov 15, 2021 · 1 comment
Closed

Refactor tests that mutate the global log object #112

lucianjon opened this issue Nov 15, 2021 · 1 comment

Comments

@lucianjon
Copy link
Contributor

There are some tests that mutate the global log object, using this helper function https://github.com/movio/bramble/blob/main/instrumentation_test.go#L14. Specifically it gives a writer to the log object that is closed at the end of the test. This can cause other tests that run code which logs to print out errors like this: Failed to write to log, io: read/write on closed pipe.

@pkqk
Copy link
Member

pkqk commented Nov 15, 2021

The testing library now has a Cleanup hook which could be used to restore the original output.

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

No branches or pull requests

2 participants