فهرست منبع

pkg/fileutil: make TestLockAndUnlock less flaky on CI

CI is slow sometime. To make the test less flaky, we increases the
timeout. This does not affect the correctness, but the test might
take longer to finish or to fail.
Xiang Li 10 سال پیش
والد
کامیت
be3e87b238
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      pkg/fileutil/lock_test.go

+ 2 - 2
pkg/fileutil/lock_test.go

@@ -78,7 +78,7 @@ func TestLockAndUnlock(t *testing.T) {
 	select {
 	select {
 	case <-locked:
 	case <-locked:
 		t.Error("unexpected unblocking")
 		t.Error("unexpected unblocking")
-	case <-time.After(10 * time.Millisecond):
+	case <-time.After(100 * time.Millisecond):
 	}
 	}
 
 
 	// unlock
 	// unlock
@@ -90,7 +90,7 @@ func TestLockAndUnlock(t *testing.T) {
 	// the previously blocked routine should be unblocked
 	// the previously blocked routine should be unblocked
 	select {
 	select {
 	case <-locked:
 	case <-locked:
-	case <-time.After(20 * time.Millisecond):
+	case <-time.After(1 * time.Second):
 		t.Error("unexpected blocking")
 		t.Error("unexpected blocking")
 	}
 	}
 }
 }