Repository: ignite Updated Branches: refs/heads/ignite-3477 c11209279 -> 18caed3a3
GridCacheTxNodeFailureSelfTest: fixed test to properly get cache entry. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/18caed3a Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/18caed3a Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/18caed3a Branch: refs/heads/ignite-3477 Commit: 18caed3a393dd40aaec3302a6882c49923ca4c2e Parents: c112092 Author: sboikov <[email protected]> Authored: Mon Jan 9 14:03:14 2017 +0300 Committer: sboikov <[email protected]> Committed: Mon Jan 9 14:03:14 2017 +0300 ---------------------------------------------------------------------- .../dht/GridCacheTxNodeFailureSelfTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/18caed3a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheTxNodeFailureSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheTxNodeFailureSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheTxNodeFailureSelfTest.java index 622fd3b..824956a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheTxNodeFailureSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheTxNodeFailureSelfTest.java @@ -300,6 +300,8 @@ public class GridCacheTxNodeFailureSelfTest extends GridCommonAbstractTest { commitLatch.await(); + Thread.sleep(1000); + stopGrid(1); // Check that thread successfully finished. @@ -341,7 +343,9 @@ public class GridCacheTxNodeFailureSelfTest extends GridCommonAbstractTest { if (backupCache.isNear()) backupCache = backupCache.context().near().dht(); - GridDhtCacheEntry dhtEntry = (GridDhtCacheEntry)backupCache.peekEx(key); + GridDhtCacheEntry dhtEntry = (GridDhtCacheEntry)backupCache.entryEx(key); + + dhtEntry.unswap(); if (commit) { assertNotNull(dhtEntry); @@ -359,9 +363,10 @@ public class GridCacheTxNodeFailureSelfTest extends GridCommonAbstractTest { } else { assertTrue("near=" + nearEntry + ", hc=" + System.identityHashCode(nearEntry), nearEntry == null); - assertTrue("Invalid backup cache entry: " + dhtEntry, - dhtEntry == null || dhtEntry.rawGet() == null); + assertTrue("Invalid backup cache entry: " + dhtEntry, dhtEntry.rawGet() == null); } + + backupCache.context().evicts().touch(dhtEntry, null); } /** @@ -406,7 +411,7 @@ public class GridCacheTxNodeFailureSelfTest extends GridCommonAbstractTest { /** * @param bannedClasses Banned classes. */ - public void bannedClasses(Collection<Class> bannedClasses) { + void bannedClasses(Collection<Class> bannedClasses) { this.bannedClasses = bannedClasses; }
