Browse Source

pkg/fileutil: wait up to 300ms for purge test

Fix https://github.com/coreos/etcd/issues/5231.

The issue shows that slow CI can take more than 200ms
for purging. This increase the loop iteration to wait
up to 300ms in case the disk is being slow.
Gyu-Ho Lee 9 năm trước cách đây
mục cha
commit
4ab1500a6d
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      pkg/fileutil/purge_test.go

+ 2 - 2
pkg/fileutil/purge_test.go

@@ -58,9 +58,9 @@ func TestPurgeFile(t *testing.T) {
 
 
 	// purge routine should purge 7 out of 10 files and only keep the
 	// purge routine should purge 7 out of 10 files and only keep the
 	// 3 most recent ones.
 	// 3 most recent ones.
-	// wait for purging for at most 100ms.
+	// Wait for purging for at most 300ms.
 	var fnames []string
 	var fnames []string
-	for i := 0; i < 10; i++ {
+	for i := 0; i < 30; i++ {
 		fnames, err = ReadDir(dir)
 		fnames, err = ReadDir(dir)
 		if err != nil {
 		if err != nil {
 			t.Fatal(err)
 			t.Fatal(err)