From 160a097d07c97bf4c9ce10a6c2cd0e2bd18bfcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:44:41 +0100 Subject: [PATCH] Fix flaky test TestDestroysRunnerAfterTimeoutAndSignal. --- internal/runner/nomad_runner_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/runner/nomad_runner_test.go b/internal/runner/nomad_runner_test.go index 7681ba2..897ed1a 100644 --- a/internal/runner/nomad_runner_test.go +++ b/internal/runner/nomad_runner_test.go @@ -263,7 +263,9 @@ func (s *ExecuteInteractivelyTestSuite) TestDestroysRunnerAfterTimeoutAndSignal( defaultExecutionID, bytes.NewBuffer(make([]byte, 1)), nil, nil, context.Background()) s.Require().NoError(err) - <-time.After(executionTimeoutGracePeriod + time.Duration(timeLimit)*time.Second + tests.ShortTimeout) + <-time.After(executionTimeoutGracePeriod + time.Duration(timeLimit)*time.Second) + // Even if we expect the timeout to be exceeded now, Poseidon sometimes take a couple of hundred ms longer. + <-time.After(2 * tests.ShortTimeout) s.manager.AssertNotCalled(s.T(), "Return", s.runner) s.apiMock.AssertCalled(s.T(), "DeleteJob", s.runner.ID()) s.True(runnerDestroyed)