Browse Source

fix: webhook test race

Moritz Johner 4 years ago
parent
commit
ce6f5b1653
1 changed files with 3 additions and 1 deletions
  1. 3 1
      pkg/provider/webhook/webhook_test.go

+ 3 - 1
pkg/provider/webhook/webhook_test.go

@@ -298,7 +298,9 @@ func testGetSecret(tc testCase, t *testing.T, client provider.SecretsClient) {
 		Key:     tc.Args.Key,
 		Version: tc.Args.Version,
 	}
-	secret, err := client.GetSecret(context.Background(), testRef)
+	ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+	defer cancel()
+	secret, err := client.GetSecret(ctx, testRef)
 	errStr := ""
 	if err != nil {
 		errStr = err.Error()