Files
atlantis/server
Finn Arne Gangstad 739d6e435b test(command-output): stabilize server jobs test (#3194)
* 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>
2023-03-07 09:24:37 -06:00
..
2022-09-12 18:08:46 -07:00
2022-12-23 11:58:10 -06:00
2023-01-18 22:02:18 -06:00