Skip to content

Commit 09086a1

Browse files
committed
Use Close instead of Dispose, because Dispose swallows the exception
1 parent 1697eac commit 09086a1

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,14 @@ public static void RunAllTestsForSingleServer_NP()
3131
}
3232
}
3333

34-
[ActiveIssue("5540")]
34+
//[ActiveIssue("5540")]
3535
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureServer), Skip = "One test fails.")]
3636
public static void RunAllTestsForSingleServer_TCP()
3737
{
38-
RunAllTestsForSingleServer(DataTestUtility.TCPConnectionString, false, false);
38+
RunAllTestsForSingleServer(DataTestUtility.TCPConnectionString, false);
3939
}
4040

41-
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureServer), nameof(DataTestUtility.IsNotNamedInstance))]
42-
public static void RunAllTestsForSingleServer_TCP_DisableFlaky()
43-
{
44-
RunAllTestsForSingleServer(DataTestUtility.TCPConnectionString, false, true);
45-
}
46-
47-
// Synapse: The statement failed. Column 'foo' has a data type that cannot participate in a columnstore index.
41+
// Synapse: The statement failed. Column 'foo' has a data type that cannot participate in a columnstore index.
4842
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
4943
public static async Task AsyncMultiPacketStreamRead()
5044
{
@@ -158,7 +152,7 @@ IF OBJECT_ID('dbo.{tableName}', 'U') IS NOT NULL
158152
return data;
159153
}
160154

161-
private static void RunAllTestsForSingleServer(string connectionString, bool usingNamePipes = false, bool disableFlakyTest = true)
155+
private static void RunAllTestsForSingleServer(string connectionString, bool usingNamePipes = false)
162156
{
163157
RowBuffer(connectionString);
164158
InvalidRead(connectionString);
@@ -194,10 +188,7 @@ private static void RunAllTestsForSingleServer(string connectionString, bool usi
194188
TimeoutDuringReadAsyncWithClosedReaderTest(connectionString);
195189
}
196190

197-
if (!disableFlakyTest)
198-
{
199-
NonFatalTimeoutDuringRead(connectionString);
200-
}
191+
NonFatalTimeoutDuringRead(connectionString);
201192
}
202193
}
203194

@@ -2084,7 +2075,7 @@ private static void NonFatalTimeoutDuringRead(string connectionString)
20842075

20852076
// Close will now observe the stored timeout error
20862077
string errorMessage = SystemDataResourceManager.Instance.SQL_Timeout_Execution;
2087-
DataTestUtility.AssertThrowsWrapper<SqlException>(reader.Dispose, errorMessage);
2078+
DataTestUtility.AssertThrowsWrapper<SqlException>(reader.Close, errorMessage);
20882079
}
20892080
}
20902081
}

0 commit comments

Comments
 (0)