Skip to content

Commit 71aefa5

Browse files
Tests | Address random error on AADPasswordWithWrongPassword test case (#1355)
1 parent c0fd7d2 commit 71aefa5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ public static void AADPasswordWithWrongPassword()
206206
string[] credKeys = { "Password", "PWD" };
207207
string connStr = DataTestUtility.RemoveKeysInConnStr(DataTestUtility.AADPasswordConnectionString, credKeys) + "Password=TestPassword;";
208208

209-
SqlException e = Assert.Throws<SqlException>(() => ConnectAndDisconnect(connStr));
209+
Assert.Throws<SqlException>(() => ConnectAndDisconnect(connStr));
210210

211-
string expectedMessage = "ID3242: The security token could not be authenticated or authorized.";
212-
Assert.Contains(expectedMessage, e.Message);
211+
// We cannot verify error message with certainity as driver may cache token from other tests for current user
212+
// and error message may change accordingly.
213213
}
214214

215215
[ConditionalFact(nameof(IsAADConnStringsSetup))]

0 commit comments

Comments
 (0)