diff --git a/sdk/opa_test.go b/sdk/opa_test.go index 14afab6a38..ad8f953c0e 100644 --- a/sdk/opa_test.go +++ b/sdk/opa_test.go @@ -483,7 +483,7 @@ func TestStopWithDeadline(t *testing.T) { dur := time.Since(before) diff := dur - timeout - maxDelta := 6 * time.Millisecond + maxDelta := 10 * time.Millisecond if diff > maxDelta || diff < -maxDelta { t.Errorf("expected shutdown to have %v grace period, measured shutdown in %v (max delta %v)", timeout, dur, maxDelta) } diff --git a/test/e2e/certrefresh/certrefresh_test.go b/test/e2e/certrefresh/certrefresh_test.go index 70fa800706..8658bc3208 100644 --- a/test/e2e/certrefresh/certrefresh_test.go +++ b/test/e2e/certrefresh/certrefresh_test.go @@ -94,6 +94,7 @@ func TestMain(m *testing.M) { } func TestCertificateRotation(t *testing.T) { + wait := 20 * time.Millisecond // file reload happens every millisecond // before rotation cert := getCert(t) @@ -103,7 +104,7 @@ func TestCertificateRotation(t *testing.T) { // replace file on disk replaceCerts(t, certFile1, certKeyFile1) - time.Sleep(10 * time.Millisecond) // file reload happens every millisecond + time.Sleep(wait) // after rotation cert = getCert(t) @@ -113,7 +114,7 @@ func TestCertificateRotation(t *testing.T) { // replace file with nothing replaceCerts(t, os.DevNull, os.DevNull) - time.Sleep(10 * time.Millisecond) + time.Sleep(wait) // second cert still used cert = getCert(t) @@ -123,7 +124,7 @@ func TestCertificateRotation(t *testing.T) { // go back to first cert replaceCerts(t, certFile0, certKeyFile0) - time.Sleep(10 * time.Millisecond) + time.Sleep(wait) cert = getCert(t) if exp, act := serial0, string(cert.SerialNumber.String()); exp != act { t.Fatalf("expected signature %s, got %s", exp, act)