Closed mislav closed 3 years ago
You're saying a global level OnInterrupt
is a bad idea?
I don't see any need to revert the PR, since there's no breaking changes. The panic that happened in #319 is because I failed to account for the case when OnInterrupt function is not set, which is fixed by #322. I still don't get how it managed to not panic on test "No OnInterrupt" tho.
Maybe you could help me understand why it didn't FAIL?
Closing this issue since it no longer applies. Thanks again @mislav
What operating system and terminal are you using? any non-Windows platform
An example that showcases the bug.
What did you expect to see? test always passes
What did you see instead?
This is caused by a race condition in a test added in #301 that spawns several
t.Run()
blocks, which themselves run in separate goroutines that enable parallel test runs by invoking theRunTest()
helper, but these tests also depend on the state of the global package-level variable OnInterrupt that changes value during the test.I could easily fix this test in a PR, but I would argue that https://github.com/AlecAivazis/survey/pull/301 should be reverted instead. /cc @infinitepr0