Defuse data race condition of TestWithSeparateStderrReturnsCommandError.

This commit is contained in:
Maximilian Paß
2023-09-11 11:07:00 +02:00
parent 6159f2a045
commit 68cd8f43b4

View File

@ -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}