浏览代码

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 2 年之前
父节点
当前提交
cd9d8f309d
共有 1 个文件被更改,包括 2 次插入4 次删除
  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 {
 				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)
 			}