From 3ce014f5f38b3ef05e0978fc855a6858dd6bbda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Pa=C3=9F?= <22845248+mpass99@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:49:34 +0100 Subject: [PATCH] Fix flaky TestSendsSignalAfterTimeout. --- internal/runner/nomad_runner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/runner/nomad_runner_test.go b/internal/runner/nomad_runner_test.go index 897ed1a..755ddd1 100644 --- a/internal/runner/nomad_runner_test.go +++ b/internal/runner/nomad_runner_test.go @@ -221,7 +221,7 @@ func (s *ExecuteInteractivelyTestSuite) TestSendsSignalAfterTimeout() { s.Require().True(ok) buffer := make([]byte, 1) //nolint:makezero,lll // If the length is zero, the Read call never reads anything. gofmt want this alignment. for n := 0; !(n == 1 && buffer[0] == SIGQUIT); { - time.After(tests.ShortTimeout) + <-time.After(tests.ShortTimeout) n, _ = stdin.Read(buffer) //nolint:errcheck,lll // Read returns EOF errors but that is expected. This nolint makes the line too long. if n > 0 { log.WithField("buffer", fmt.Sprintf("%x", buffer[0])).Info("Received Stdin")