Skip to content

Commit 5481f2a

Browse files
committed
TransactionNotificationFixture: ShouldNotifyAfterDistributedTransactionWithOwnConnection(): Transaction completion may happen asynchronously, so allow some delay. Affects some drivers.
1 parent b59a55f commit 5481f2a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/NHibernate.Test/SystemTransactions/TransactionNotificationFixture.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Data;
4+
using System.Threading;
45
using System.Transactions;
56
using NUnit.Framework;
67

@@ -185,7 +186,9 @@ public void ShouldNotifyAfterDistributedTransactionWithOwnConnection(bool doComm
185186
}
186187
}
187188

188-
Assert.That(s1.IsOpen, Is.False);
189+
// Transaction completion may happen asynchronously, so allow some delay.
190+
Assert.That(() => s1.IsOpen, Is.False.After(500, 100));
191+
189192
Assert.That(interceptor.afterTransactionCompletionCalled, Is.EqualTo(1));
190193
}
191194

0 commit comments

Comments
 (0)