From 68cd8f43b451ac39ad55c272881f3db66f401156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:07:00 +0200 Subject: [PATCH] Defuse data race condition of TestWithSeparateStderrReturnsCommandError. --- internal/nomad/nomad_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/nomad/nomad_test.go b/internal/nomad/nomad_test.go index 4a36f757..f95d78c7 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}