Skip to content

Commit af0a376

Browse files
Test | Skip unsupported tests on Synapse (#1884)
1 parent c585669 commit af0a376

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectionPoolTest/TransactionPoolTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ public static class TransactionPoolTest
88
/// <summary>
99
/// Tests if connections in a distributed transaction are put into a transaction pool. Also checks that clearallpools
1010
/// does not clear transaction connections and that the transaction root is put into "stasis" when closed
11+
/// Synapse: only supports local transaction request.
1112
/// </summary>
12-
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
13+
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
1314
[ClassData(typeof(ConnectionPoolConnectionStringProvider))]
1415
public static void BasicTransactionPoolTest(string connectionString)
1516
{
@@ -63,9 +64,10 @@ public static void BasicTransactionPoolTest(string connectionString)
6364

6465
/// <summary>
6566
/// Checks that connections in the transaction pool are not cleaned out, and the root transaction is put into "stasis" when it ages
67+
/// Synapse: only supports local transaction request.
6668
/// </summary>
6769
/// <param name="connectionString"></param>
68-
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
70+
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
6971
[ClassData(typeof(ConnectionPoolConnectionStringProvider))]
7072
public static void TransactionCleanupTest(string connectionString)
7173
{

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderCancellationTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ public class DataReaderCancellationTest
1414
/// <summary>
1515
/// Test ensures cancellation token is registered before ReadAsync starts processing results from TDS Stream,
1616
/// such that when Cancel is triggered, the token is capable of canceling reading further results.
17+
/// Synapse: Incompatible query.
1718
/// </summary>
1819
/// <returns>Async Task</returns>
19-
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
20+
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
2021
public static async Task CancellationTokenIsRespected_ReadAsync()
2122
{
2223
const string longRunningQuery = @"
@@ -49,9 +50,10 @@ await Assert.ThrowsAsync<TaskCanceledException>(async () =>
4950
/// <summary>
5051
/// Test ensures cancellation token is registered before ReadAsync starts processing results from TDS Stream,
5152
/// such that when Cancel is triggered, the token is capable of canceling reading further results.
53+
/// Synapse: Incompatible query & Parallel query execution on the same connection is not supported.
5254
/// </summary>
5355
/// <returns>Async Task</returns>
54-
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
56+
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
5557
public static async Task CancelledCancellationTokenIsRespected_ReadAsync()
5658
{
5759
const string longRunningQuery = @"

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderStreamsTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ public static async Task GetFieldValueAsync_Char_OfTextReader(CommandBehavior be
153153
Assert.Equal(originalText, outputText);
154154
}
155155

156-
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
156+
// Synapse: Cannot find data type 'XML'.
157+
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
157158
[MemberData(nameof(GetCommandBehavioursAndIsAsync))]
158159
public static async void GetFieldValue_OfXmlReader(CommandBehavior behavior, bool isExecuteAsync)
159160
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ public static void MARSSyncTimeoutTest()
162162
}
163163
}
164164
#endif
165-
166-
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
165+
// Synapse: Parallel query execution on the same connection is not supported.
166+
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
167167
public static async Task MARSAsyncBusyReaderTest()
168168
{
169169
using SqlConnection con = new(_connStr);

0 commit comments

Comments
 (0)