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

This commit is contained in:
Joan López de la Franca Beltran
2021-12-28 13:34:45 +01:00
committed by GitHub
parent 56c3875bb9
commit 80e0dd74d2

View File

@@ -277,15 +277,15 @@ func TestSecretsService_Run(t *testing.T) {
require.Len(t, svc.dataKeyCache, 1) require.Len(t, svc.dataKeyCache, 1)
// Execute background process after key's TTL, to force // Execute background process after key's TTL, to force
// clean up process, during a millisecond with gc ticker // clean up process, during a hundred milliseconds with
// configured on every nanosecond, to ensure the ticker // gc ticker configured on every nanosecond, to ensure
// is triggered. // the ticker is triggered.
gcInterval = time.Nanosecond gcInterval = time.Nanosecond
t.Cleanup(func() { now = time.Now }) t.Cleanup(func() { now = time.Now })
now = func() time.Time { return time.Now().Add(dekTTL) } 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() defer cancel()
err = svc.Run(ctx) err = svc.Run(ctx)