Skip to content

Commit 37f3572

Browse files
Add a test case for system transactions timeout
1 parent a958ff1 commit 37f3572

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/NHibernate.Test/SystemTransactions/SystemTransactionFixture.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,26 @@ public void CanUseSessionWithManyDependentTransaction(bool explicitFlush)
643643
}
644644
}
645645

646+
[Test]
647+
public void SupportsTransactionTimeout()
648+
{
649+
// Test case adapted from https://github.com/kaksmet/NHibBugRepro
650+
using (var s = OpenSession())
651+
using (var t = s.BeginTransaction())
652+
{
653+
for (var i = 0; i < 5000; i++)
654+
{
655+
var person = new Person();
656+
s.Save(person);
657+
}
658+
659+
t.Commit();
660+
}
661+
662+
var txOptions = new TransactionOptions { Timeout = TimeSpan.FromMilliseconds(1) };
663+
664+
}
665+
646666
[Theory, Explicit("Bench")]
647667
public void BenchTransactionAccess(bool inTransaction)
648668
{

0 commit comments

Comments
 (0)