diff --git a/internal/nomad/nomad_test.go b/internal/nomad/nomad_test.go index 4a36f75..f95d78c 100644 --- a/internal/nomad/nomad_test.go +++ b/internal/nomad/nomad_test.go @@ -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}