Unified/APIStore: Fix flaky tests on secure value support inline (#109806)

This commit is contained in:
Matheus Macabu 2025-08-19 09:49:44 +02:00 committed by GitHub
parent bdd5bf0397
commit ea833ddf1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -70,7 +70,10 @@ func TestSecureLifecycle(t *testing.T) {
expectError := fmt.Errorf("expected error")
secureStore := secret.NewMockInlineSecureValueSupport(t)
secureStore.On("CreateInline", mock.Anything, mock.Anything, common.RawSecureValue("SecretAAA")).
Return("", expectError).Once()
Return("", expectError).Maybe()
secureStore.On("CreateInline", mock.Anything, mock.Anything, common.RawSecureValue("SecretBBB")).
Return("", expectError).Maybe()
err := prepareSecureValues(context.Background(), secureStore, obj, nil, info)
require.Error(t, err, "should error when secure value creation fails")
require.Equal(t, expectError, err, "error should be propagated")