Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libraries/System.Transactions.Local/tests/OleTxTests.cs')
-rw-r--r--src/libraries/System.Transactions.Local/tests/OleTxTests.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libraries/System.Transactions.Local/tests/OleTxTests.cs b/src/libraries/System.Transactions.Local/tests/OleTxTests.cs
index 6a97aed542a..e646c09a593 100644
--- a/src/libraries/System.Transactions.Local/tests/OleTxTests.cs
+++ b/src/libraries/System.Transactions.Local/tests/OleTxTests.cs
@@ -433,6 +433,34 @@ public class OleTxTests : IClassFixture<OleTxTests.OleTxFixture>
Assert.Equal(tx.TransactionInformation.DistributedIdentifier, tx2.TransactionInformation.DistributedIdentifier);
});
+ // Test currently skipped, #74745
+ private void GetDtcTransaction()
+ => Test(() =>
+ {
+ using var tx = new CommittableTransaction();
+
+ var outcomeReceived = new AutoResetEvent(false);
+
+ var enlistment = new TestEnlistment(
+ Phase1Vote.Prepared, EnlistmentOutcome.Committed, outcomeReceived: outcomeReceived);
+
+ Assert.Equal(Guid.Empty, tx.PromoterType);
+
+ tx.EnlistVolatile(enlistment, EnlistmentOptions.None);
+
+ // Forces promotion to MSDTC, returns an ITransaction for use only with System.EnterpriseServices.
+ _ = TransactionInterop.GetDtcTransaction(tx);
+
+ Assert.Equal(TransactionStatus.Active, tx.TransactionInformation.Status);
+ Assert.Equal(TransactionInterop.PromoterTypeDtc, tx.PromoterType);
+
+ tx.Commit();
+
+ Assert.True(outcomeReceived.WaitOne(Timeout));
+ Assert.Equal(EnlistmentOutcome.Committed, enlistment.Outcome);
+ Retry(() => Assert.Equal(TransactionStatus.Committed, tx.TransactionInformation.Status));
+ });
+
private static void Test(Action action)
{
// Temporarily skip on 32-bit where we have an issue.