Skip to content

Commit

Permalink
Test | Skip unsupported tests on Synapse (#1884)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavoudEshtehari committed Jan 11, 2023
1 parent c585669 commit af0a376
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ public static class TransactionPoolTest
/// <summary>
/// Tests if connections in a distributed transaction are put into a transaction pool. Also checks that clearallpools
/// does not clear transaction connections and that the transaction root is put into "stasis" when closed
/// Synapse: only supports local transaction request.
/// </summary>
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
[ClassData(typeof(ConnectionPoolConnectionStringProvider))]
public static void BasicTransactionPoolTest(string connectionString)
{
Expand Down Expand Up @@ -63,9 +64,10 @@ public static void BasicTransactionPoolTest(string connectionString)

/// <summary>
/// Checks that connections in the transaction pool are not cleaned out, and the root transaction is put into "stasis" when it ages
/// Synapse: only supports local transaction request.
/// </summary>
/// <param name="connectionString"></param>
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
[ClassData(typeof(ConnectionPoolConnectionStringProvider))]
public static void TransactionCleanupTest(string connectionString)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ public class DataReaderCancellationTest
/// <summary>
/// Test ensures cancellation token is registered before ReadAsync starts processing results from TDS Stream,
/// such that when Cancel is triggered, the token is capable of canceling reading further results.
/// Synapse: Incompatible query.
/// </summary>
/// <returns>Async Task</returns>
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
public static async Task CancellationTokenIsRespected_ReadAsync()
{
const string longRunningQuery = @"
Expand Down Expand Up @@ -49,9 +50,10 @@ ThousandRows as (select A.Value as A, B.Value as B, C.Value as C from TenRows as
/// <summary>
/// Test ensures cancellation token is registered before ReadAsync starts processing results from TDS Stream,
/// such that when Cancel is triggered, the token is capable of canceling reading further results.
/// Synapse: Incompatible query & Parallel query execution on the same connection is not supported.
/// </summary>
/// <returns>Async Task</returns>
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
public static async Task CancelledCancellationTokenIsRespected_ReadAsync()
{
const string longRunningQuery = @"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public static async Task GetFieldValueAsync_Char_OfTextReader(CommandBehavior be
Assert.Equal(originalText, outputText);
}

[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
// Synapse: Cannot find data type 'XML'.
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
[MemberData(nameof(GetCommandBehavioursAndIsAsync))]
public static async void GetFieldValue_OfXmlReader(CommandBehavior behavior, bool isExecuteAsync)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ public static void MARSSyncTimeoutTest()
}
}
#endif

[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup))]
// Synapse: Parallel query execution on the same connection is not supported.
[ConditionalFact(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringsSetup), nameof(DataTestUtility.IsNotAzureSynapse))]
public static async Task MARSAsyncBusyReaderTest()
{
using SqlConnection con = new(_connStr);
Expand Down

0 comments on commit af0a376

Please sign in to comment.