This is an automated email from the ASF dual-hosted git repository.

ptupitsyn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new e06df80fb28 IGNITE-26495 .NET: Fix 
TestReadOnlyTxSeesOldDataAfterUpdate flakiness (#6706)
e06df80fb28 is described below

commit e06df80fb288756a26378cb8295306113ce4705a
Author: Pavel Tupitsyn <[email protected]>
AuthorDate: Mon Oct 6 18:31:23 2025 +0300

    IGNITE-26495 .NET: Fix TestReadOnlyTxSeesOldDataAfterUpdate flakiness 
(#6706)
---
 .../Transactions/TransactionsTests.cs              | 23 +++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git 
a/modules/platforms/dotnet/Apache.Ignite.Tests/Transactions/TransactionsTests.cs
 
b/modules/platforms/dotnet/Apache.Ignite.Tests/Transactions/TransactionsTests.cs
index 188bb5d8ef5..e7433c08d3b 100644
--- 
a/modules/platforms/dotnet/Apache.Ignite.Tests/Transactions/TransactionsTests.cs
+++ 
b/modules/platforms/dotnet/Apache.Ignite.Tests/Transactions/TransactionsTests.cs
@@ -211,27 +211,36 @@ namespace Apache.Ignite.Tests.Transactions
         [Test]
         public async Task TestReadOnlyTxSeesOldDataAfterUpdate([Values(true, 
false)] bool readBeforeUpdate)
         {
+            // TODO IGNITE-26619 Implicit client ro tx does not include 
observableTimestamp - remove workaround below.
+            // Use single-node connection to work around causality issues due 
to round-robin in GetNextSocketWithoutReconnect.
+            var cfg = GetConfig();
+            cfg.Endpoints.Clear();
+            cfg.Endpoints.Add($"127.0.0.1:{ServerPort}");
+
+            using var client = await IgniteClient.StartAsync(cfg);
+            var recordView = (await 
client.Tables.GetTableAsync(TableName))!.GetRecordView<Poco>();
+
             var key = Random.Shared.NextInt64(1000, long.MaxValue);
             var keyPoco = new Poco { Key = key };
 
-            await PocoView.UpsertAsync(null, new Poco { Key = key, Val = "11" 
});
+            await recordView.UpsertAsync(null, new Poco { Key = key, Val = 
"11" });
 
-            await using var roTx = await Client.Transactions.BeginAsync(new 
TransactionOptions { ReadOnly = true });
+            await using var roTx = await client.Transactions.BeginAsync(new 
TransactionOptions { ReadOnly = true });
 
             if (readBeforeUpdate)
             {
-                Assert.AreEqual("11", (await PocoView.GetAsync(roTx, 
keyPoco)).Value.Val);
+                Assert.AreEqual("11", (await recordView.GetAsync(roTx, 
keyPoco)).Value.Val);
             }
 
             // Update data in a different (implicit) tx.
-            await PocoView.UpsertAsync(transaction: null, new Poco { Key = 
key, Val = "22" });
+            await recordView.UpsertAsync(transaction: null, new Poco { Key = 
key, Val = "22" });
 
             // Old read-only tx sees old data.
-            Assert.AreEqual("11", (await PocoView.GetAsync(roTx, 
keyPoco)).Value.Val);
+            Assert.AreEqual("11", (await recordView.GetAsync(roTx, 
keyPoco)).Value.Val);
 
             // New tx sees new data
-            await using var tx3 = await Client.Transactions.BeginAsync(new 
TransactionOptions { ReadOnly = true });
-            Assert.AreEqual("22", (await PocoView.GetAsync(tx3, 
keyPoco)).Value.Val);
+            await using var tx3 = await client.Transactions.BeginAsync(new 
TransactionOptions { ReadOnly = true });
+            Assert.AreEqual("22", (await recordView.GetAsync(tx3, 
keyPoco)).Value.Val);
         }
 
         [Test]

Reply via email to