Defuse data race condition of TestWithSeparateStderrReturnsCommandError.
This commit is contained in:
@ -837,6 +837,8 @@ func (s *ExecuteCommandTestSuite) TestWithSeparateStderrReturnsCommandError() {
|
|||||||
s.Require().True(ok)
|
s.Require().True(ok)
|
||||||
|
|
||||||
if isStderrCommand := strings.Contains(calledCommand, "mkfifo"); isStderrCommand {
|
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}
|
call.ReturnArguments = mock.Arguments{1, nil}
|
||||||
} else {
|
} else {
|
||||||
call.ReturnArguments = mock.Arguments{1, tests.ErrDefault}
|
call.ReturnArguments = mock.Arguments{1, tests.ErrDefault}
|
||||||
|
Reference in New Issue
Block a user