Skip to content

Commit

Permalink
Defuse data race condition of TestWithSeparateStderrReturnsCommandError.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpass99 committed Sep 11, 2023
1 parent 6159f2a commit 68cd8f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/nomad/nomad_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,8 @@ func (s *ExecuteCommandTestSuite) TestWithSeparateStderrReturnsCommandError() {
s.Require().True(ok)

if isStderrCommand := strings.Contains(calledCommand, "mkfifo"); isStderrCommand {
// Here we defuse the data race condition of the ReturnArguments being set twice at the same time.
<-time.After(tests.ShortTimeout)
call.ReturnArguments = mock.Arguments{1, nil}
} else {
call.ReturnArguments = mock.Arguments{1, tests.ErrDefault}
Expand Down

0 comments on commit 68cd8f4

Please sign in to comment.