Skip to content

Commit 67227e9

Browse files
committed
NH-3900 - Fix failing DtcFailuresFixture test.
There's no documented guarantee that IEnlistmentNotification.Prepare will be called from a different thread.
1 parent f9b60ce commit 67227e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,11 @@ public ForceEscalationToDistributedTx() : this(false) {}
331331

332332
public void Prepare(PreparingEnlistment preparingEnlistment)
333333
{
334-
Assert.AreNotEqual(thread, Thread.CurrentThread.ManagedThreadId);
334+
if (thread == Thread.CurrentThread.ManagedThreadId)
335+
{
336+
log.Warn("Thread.CurrentThread.ManagedThreadId ({0}) is same as creation thread");
337+
}
338+
335339
if (shouldRollBack)
336340
{
337341
log.Debug(">>>>Force Rollback<<<<<");

0 commit comments

Comments
 (0)