mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-06 17:58:41 +00:00
* Bugfix: TestProjectCommandOutputHandler is unstable Use buffered channels in TestProjectCommandOutputHandler The output handler registered with ProjectCommandOutputHandler.Register() needs the channel that is given to not block writes. If the channel blocks writes, the channel is removed from the list of active receivers on that JobID. The tests are set up with unbuffered channels, and there is a race condition where the channel reader does not hit `for msg := range ch` before the message that is sent is handled by AsyncProjectCommandOutputHandler.writeLogLine By making the channel buffered it does not matter that the reader isn't reading yet. * Add missing wg.Wait() in TestProjectCommandOutputHandler There is a rare race condition where messages come in while the asserts run in the "clean up all jobs when PR is closed" test. Added wg.Wait() to make sure all messages are processed before running the final asserts. --------- Co-authored-by: Finn Arne Gangstad <finnag@gmail.com>