Skip to content

Commit 88bc587

Browse files
NH-2176 - adjusted SQLite case, which only seems to have one flaky test now, with the generalization of WaitOne in session closed check.
1 parent 0b09288 commit 88bc587

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

src/NHibernate.Test/NHSpecificTest/DtcFailures/DtcFailuresFixture.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using log4net.Repository.Hierarchy;
99
using NHibernate.Cfg;
1010
using NHibernate.Cfg.MappingSchema;
11+
using NHibernate.Dialect;
1112
using NHibernate.Linq;
1213
using NHibernate.Tool.hbm2ddl;
1314
using NUnit.Framework;
@@ -26,7 +27,7 @@ protected override string MappingsAssembly
2627
=> "NHibernate.Test";
2728

2829
protected override bool AppliesTo(Dialect.Dialect dialect)
29-
=> true || dialect.SupportsDistributedTransactions;
30+
=> dialect.SupportsDistributedTransactions;
3031

3132
protected override void CreateSchema()
3233
{
@@ -502,6 +503,9 @@ public void CanDeleteItemInDtc()
502503
[Test]
503504
public void CanDeleteItemInDtcWithFlush()
504505
{
506+
if (Dialect is SQLiteDialect)
507+
Assert.Ignore("Flaky test with SQLite.");
508+
505509
object id;
506510
using (var tx = new TransactionScope())
507511
{

src/NHibernate.Test/TestCase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ private bool CheckSessionsWereClosed()
221221
var allClosed = true;
222222
foreach (var session in _openedSessions)
223223
{
224+
session.GetSessionImplementation().TransactionContext?.WaitOne();
224225
if (session.IsOpen)
225226
{
226227
log.Error($"Test case didn't close session {session.GetSessionImplementation().SessionId}, closing");

src/NHibernate/Dialect/SQLiteDialect.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -340,20 +340,6 @@ public override bool SupportsForeignKeyConstraintInAlterTable
340340
/// </remarks>
341341
public override bool SupportsConcurrentWritingConnections => false;
342342

343-
#region Informational metadata
344-
345-
/// <summary>
346-
/// Does this dialect support distributed transaction?
347-
/// </summary>
348-
/// <remarks>
349-
/// Inconsistent behavior, sometimes failing persisting data from a committed distributed transaction
350-
/// (as illustrated by CanDeleteItemInDtc test), sometimes failing to rollback changes instead
351-
/// (as illustrated by Can_roll_back_transaction).
352-
/// </remarks>
353-
public override bool SupportsDistributedTransactions => false;
354-
355-
#endregion
356-
357343
[Serializable]
358344
protected class SQLiteCastFunction : CastFunction
359345
{

0 commit comments

Comments
 (0)