Encryption: Increase context timeout on flaky test (#43553) (#43574)

(cherry picked from commit 80e0dd74d2)
This commit is contained in:
Joan López de la Franca Beltran
2021-12-29 10:43:22 +01:00
committed by GitHub
parent 40bee1a534
commit 27e65a5a10
+4 -4
View File
@@ -277,15 +277,15 @@ func TestSecretsService_Run(t *testing.T) {
require.Len(t, svc.dataKeyCache, 1)
// Execute background process after key's TTL, to force
// clean up process, during a millisecond with gc ticker
// configured on every nanosecond, to ensure the ticker
// is triggered.
// clean up process, during a hundred milliseconds with
// gc ticker configured on every nanosecond, to ensure
// the ticker is triggered.
gcInterval = time.Nanosecond
t.Cleanup(func() { now = time.Now })
now = func() time.Time { return time.Now().Add(dekTTL) }
ctx, cancel := context.WithTimeout(ctx, time.Millisecond)
ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond)
defer cancel()
err = svc.Run(ctx)