Pārlūkot izejas kodu

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
mmetc 1 gadu atpakaļ
vecāks
revīzija
cd9d8f309d
1 mainītis faili ar 2 papildinājumiem un 4 dzēšanām
  1. 2 4
      pkg/acquisition/modules/file/file_test.go

+ 2 - 4
pkg/acquisition/modules/file/file_test.go

@@ -410,9 +410,7 @@ force_inotify: true`, testPattern),
 
 
 			if tc.expectedLines != 0 {
 			if tc.expectedLines != 0 {
 				fd, err := os.Create("test_files/stream.log")
 				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++ {
 				for i := 0; i < 5; i++ {
 					_, err = fmt.Fprintf(fd, "%d\n", i)
 					_, err = fmt.Fprintf(fd, "%d\n", i)
@@ -424,7 +422,7 @@ force_inotify: true`, testPattern),
 
 
 				fd.Close()
 				fd.Close()
 				// we sleep to make sure we detect the new file
 				// 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")
 				os.Remove("test_files/stream.log")
 				assert.Equal(t, tc.expectedLines, actualLines)
 				assert.Equal(t, tc.expectedLines, actualLines)
 			}
 			}