|
12 | 12 |
|
13 | 13 | namespace Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted |
14 | 14 | { |
| 15 | + [Trait("Set", "AE")] |
15 | 16 | public class AKVTest : IClassFixture<SQLSetupStrategyAzureKeyVault> |
16 | 17 | { |
17 | 18 | private readonly SQLSetupStrategyAzureKeyVault _fixture; |
@@ -59,12 +60,12 @@ public void TestEncryptDecryptWithAKV() |
59 | 60 | } |
60 | 61 |
|
61 | 62 | /* |
62 | | - This unit test is going to assess an issue where a failed decryption leaves a connection in a bad state |
| 63 | + This unit test is going to assess an issue where a failed decryption leaves a connection in a bad state |
63 | 64 | when it is returned to the connection pool. If a subsequent connection is retried it will result in an "Internal connection fatal error", |
64 | | - which causes that connection to be doomed, preventing it from being returned to the pool. |
| 65 | + which causes that connection to be doomed, preventing it from being returned to the pool. |
65 | 66 | Consequently, retrying a third connection will encounter the same decryption error, leading to a repetitive failure cycle. |
66 | 67 |
|
67 | | - The purpose of this unit test is to simulate a decryption error and verify that the connection remains usable when returned to the pool. |
| 68 | + The purpose of this unit test is to simulate a decryption error and verify that the connection remains usable when returned to the pool. |
68 | 69 | It aims to confirm that three consecutive connections will consistently fail with the "Failed to decrypt column" error. |
69 | 70 | */ |
70 | 71 | [ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringSetupForAE), nameof(DataTestUtility.IsAKVSetupAvailable))] |
@@ -100,10 +101,10 @@ public void ForcedColumnDecryptErrorTestShouldFail() |
100 | 101 | // does not leave the connection in a bad state. |
101 | 102 | // In each try, when a "Failed to decrypt error" is thrown, the connection's TDS Parser state object buffer is drained of any |
102 | 103 | // pending data so it does not interfere with future operations. In addition, the TDS parser state object's reader.DataReady flag |
103 | | - // is set to false so that the calling function that catches the exception will not continue to use the reader. Otherwise, it will |
| 104 | + // is set to false so that the calling function that catches the exception will not continue to use the reader. Otherwise, it will |
104 | 105 | // timeout waiting to read data that doesn't exist. Also, the TDS Parser state object HasPendingData flag is also set to false |
105 | 106 | // to indicate that the buffer has been cleared and to avoid it getting cleared again in SqlDataReader.TryCloseInternal function. |
106 | | - // Finally, after successfully handling the decryption error, the connection is then returned back to the connection pool without |
| 107 | + // Finally, after successfully handling the decryption error, the connection is then returned back to the connection pool without |
107 | 108 | // an error. A proof that the connection's state object is clean is in the second connection being able to throw the same error. |
108 | 109 | // The third connection is for making sure we test 3 times as the minimum number of connections to reproduce the issue previously. |
109 | 110 | for (int i = 0; i < 3; i++) |
@@ -182,7 +183,7 @@ public void TestLocalCekCacheIsScopedToProvider() |
182 | 183 | sqlDataReader2.Close(); |
183 | 184 |
|
184 | 185 | // global cek cache and local cek cache are populated above |
185 | | - // when using a new per-command provider, it will only use its local cek cache |
| 186 | + // when using a new per-command provider, it will only use its local cek cache |
186 | 187 | // the following query should fail due to an empty cek cache and invalid credentials |
187 | 188 | customProvider[SqlColumnEncryptionAzureKeyVaultProvider.ProviderName] = |
188 | 189 | new SqlColumnEncryptionAzureKeyVaultProvider(new ClientSecretCredential("tenant", "client", "secret")); |
|
0 commit comments