Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix subscription stress test in notifier (#269)
While I was trying to fix another problem in the notifier's subscription stress test, I ended up introducing another one by using a single wait group for both the notification sending goroutine and subscriptions loops which caused the test intermittency described in #268. The test was ending too soon, and channels would only receive 1-2 messages, and sometimes zero (which would fail the test). notifier_test.go:462: Channel 0 contains 2 message(s) notifier_test.go:462: Channel 1 contains 2 message(s) notifier_test.go:462: Channel 2 contains 2 message(s) notifier_test.go:462: Channel 3 contains 2 message(s) notifier_test.go:462: Channel 4 contains 2 message(s) notifier_test.go:462: Channel 5 contains 2 message(s) notifier_test.go:462: Channel 6 contains 2 message(s) notifier_test.go:462: Channel 7 contains 0 message(s) Here, fix the problem by putting in different symbols for the notification send and subscription loops. The proper order of operations to finish the test are: 1. Wait for all subscription groups to finish. 2. Tell the notification send loop to shut down. 3. Wait for the notification send loop to return (so as not to introduce any goroutine leaks like had been present before). Fixes #268.
- Loading branch information