Skip to content

Commit 13ba048

Browse files
authored
IGNITE-28706 Fix TxWithExceptionalInterceptorTest.testTxWithExceptionInterceptor fails (apache#13162)
1 parent 70f53e3 commit 13ba048

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

modules/calcite/src/test/java/org/apache/ignite/internal/processors/tx/TxWithExceptionalInterceptorTest.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public void testTxWithExceptionInterceptor() throws Exception {
305305
IgniteCache<Integer, Integer> commonCache = txNode.cache(COMMON_CACHE_NAME);
306306

307307
Integer primaryKey = primaryKeyCoordAware(PROC_CACHE_NAME);
308-
Integer primaryKeyCommon = primaryKeyCoordAware(PROC_CACHE_NAME);
308+
Integer primaryKeyCommon = primaryKeyCoordAware(COMMON_CACHE_NAME);
309309

310310
try (Transaction tx = txNode.transactions().txStart()) {
311311
processedCache.put(primaryKey, 1);
@@ -325,18 +325,22 @@ public void testTxWithExceptionInterceptor() throws Exception {
325325

326326
// 2 server nodes + 1 thick client
327327
if ((txCoord == TxCoordNodeRole.BACKUP || txCoord == TxCoordNodeRole.PRIMARY) ||
328-
!writeThrough && txCoord == TxCoordNodeRole.THICK_CLIENT)
328+
!writeThrough && txCoord == TxCoordNodeRole.THICK_CLIENT) {
329329
waitForTopology(3);
330330

331+
// Topology can change but affinity change is still in progress, thus sql operations can be mapped erroneously.
332+
awaitPartitionMapExchange();
333+
}
334+
331335
checkExceptionRaised();
332336

333-
// external storage stored result
337+
// External storage stored result.
334338
Object storeVal = null;
335339

336340
if (writeThrough)
337341
storeVal = strategy.getFromStore(primaryKey);
338342

339-
// Processed cache kv result
343+
// Processed cache kv result.
340344
Object kvVal = null;
341345

342346
List<Ignite> grids = new ArrayList<>(G.allGrids());
@@ -347,7 +351,7 @@ public void testTxWithExceptionInterceptor() throws Exception {
347351
}
348352
});
349353

350-
// client first
354+
// Client first.
351355
assertTrue(grids.get(0).name().contains(CLIENT_NAME));
352356

353357
for (Ignite node : grids) {
@@ -363,7 +367,7 @@ public void testTxWithExceptionInterceptor() throws Exception {
363367
continue;
364368
}
365369

366-
// obtain sql results first, kv api can eventually recover results, thus for more clear test - let`s check sql first
370+
// Obtain sql results first, kv api can eventually recover results, thus for more clear test - let`s check sql first.
367371
Object sqlVal = getSqlResultByKey(node, PROC_CACHE_NAME, primaryKey, false);
368372

369373
if (kvVal == null)

0 commit comments

Comments
 (0)