Skip to content

Commit 9ac65b2

Browse files
Ignore cancel query test under linux for Sql Server and Oracle
1 parent cbced3f commit 9ac65b2

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

src/NHibernate.Test/Async/Stateless/StatelessSessionCancelQueryFixture.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ protected override void OnTearDown()
7474

7575
protected override bool AppliesTo(Dialect.Dialect dialect)
7676
{
77-
return TestDialect.SupportsSelectForUpdate;
77+
return TestDialect.SupportsCancelQuery &&
78+
TestDialect.SupportsSelectForUpdate;
7879
}
7980

8081
private async Task CancelQueryTestAsync(Action<IStatelessSession> queryAction, CancellationToken cancellationToken = default(CancellationToken))

src/NHibernate.Test/Stateless/StatelessSessionCancelQueryFixture.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ protected override void OnTearDown()
6464

6565
protected override bool AppliesTo(Dialect.Dialect dialect)
6666
{
67-
return TestDialect.SupportsSelectForUpdate;
67+
return TestDialect.SupportsCancelQuery &&
68+
TestDialect.SupportsSelectForUpdate;
6869
}
6970

7071
private void CancelQueryTest(Action<IStatelessSession> queryAction)

src/NHibernate.Test/TestDialect.cs

+5
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,10 @@ public bool SupportsSqlType(SqlType sqlType)
198198
/// Returns true if you can modify the same table which you use in the SELECT part.
199199
/// </summary>
200200
public virtual bool SupportsModifyAndSelectSameTable => true;
201+
202+
/// <summary>
203+
/// Returns true if you can cancel a query.
204+
/// </summary>
205+
public virtual bool SupportsCancelQuery => true;
201206
}
202207
}

src/NHibernate.Test/TestDialects/MsSql2008TestDialect.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace NHibernate.Test.TestDialects
1+
using System.Runtime.InteropServices;
2+
3+
namespace NHibernate.Test.TestDialects
24
{
35
public class MsSql2008TestDialect : TestDialect
46
{
@@ -11,5 +13,9 @@ public MsSql2008TestDialect(Dialect.Dialect dialect)
1113
/// Does not support SELECT FOR UPDATE with paging
1214
/// </summary>
1315
public override bool SupportsSelectForUpdateWithPaging => false;
16+
17+
/// <inheritdoc />
18+
/// <remarks>Canceling a query hangs under Linux with Sql2008ClientDriver. (It may be a data provider bug fixed with MicrosoftDataSqlClientDriver.)</remarks>
19+
public override bool SupportsCancelQuery => !RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
1420
}
1521
}

src/NHibernate.Test/TestDialects/Oracle10gTestDialect.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace NHibernate.Test.TestDialects
1+
using System.Runtime.InteropServices;
2+
3+
namespace NHibernate.Test.TestDialects
24
{
35
public class Oracle10gTestDialect : TestDialect
46
{
@@ -12,5 +14,9 @@ public Oracle10gTestDialect(Dialect.Dialect dialect) : base(dialect)
1214
public override bool SupportsSelectForUpdateWithPaging => false;
1315

1416
public override bool SupportsAggregateInSubSelect => true;
17+
18+
/// <inheritdoc />
19+
/// <remarks>Canceling a query hangs under Linux with OracleManagedDataClientDriver 21.6.1.</remarks>
20+
public override bool SupportsCancelQuery => !RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
1521
}
1622
}

0 commit comments

Comments
 (0)