From cd9d8f309d074ffb05678468695b5c9847023f92 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Tue, 8 Aug 2023 16:11:32 +0200 Subject: [PATCH] CI: increase test sleep to fix flaky acquisition/file test under win (#2410) * CI: increase test sleep to attempt fix for flaky windows acquitition/file test * wip --- pkg/acquisition/modules/file/file_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/acquisition/modules/file/file_test.go b/pkg/acquisition/modules/file/file_test.go index 3b39cf6bd..410beb4bc 100644 --- a/pkg/acquisition/modules/file/file_test.go +++ b/pkg/acquisition/modules/file/file_test.go @@ -410,9 +410,7 @@ force_inotify: true`, testPattern), if tc.expectedLines != 0 { fd, err := os.Create("test_files/stream.log") - if err != nil { - t.Fatalf("could not create test file : %s", err) - } + require.NoError(t, err, "could not create test file") for i := 0; i < 5; i++ { _, err = fmt.Fprintf(fd, "%d\n", i) @@ -424,7 +422,7 @@ force_inotify: true`, testPattern), fd.Close() // we sleep to make sure we detect the new file - time.Sleep(1 * time.Second) + time.Sleep(3 * time.Second) os.Remove("test_files/stream.log") assert.Equal(t, tc.expectedLines, actualLines) }