Repository: ignite Updated Branches: refs/heads/ignite-3479 b201a9647 -> e856e97f5
ignite-3479 Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e856e97f Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e856e97f Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e856e97f Branch: refs/heads/ignite-3479 Commit: e856e97f5f709ae158797f68ae8f48b131901a65 Parents: b201a96 Author: sboikov <[email protected]> Authored: Fri Sep 29 13:20:12 2017 +0300 Committer: sboikov <[email protected]> Committed: Fri Sep 29 13:20:12 2017 +0300 ---------------------------------------------------------------------- .../cache/mvcc/CacheMvccTransactionsTest.java | 66 ++++++++++++++++++++ 1 file changed, 66 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/e856e97f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java index 487f2d0..466a936 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccTransactionsTest.java @@ -1802,6 +1802,72 @@ public class CacheMvccTransactionsTest extends GridCommonAbstractTest { /** * @throws Exception If failed. */ + public void testCoordinatorChangeActiveQueryClientFails_Simple() throws Exception { + testSpi = true; + + client = false; + + final int SRVS = 3; + final int COORDS = 1; + + startGrids(SRVS + COORDS); + + client = true; + + Ignite client = startGrid(SRVS + COORDS); + + final IgniteCache cache = client.createCache(cacheConfiguration(PARTITIONED, FULL_SYNC, 0, DFLT_PARTITION_COUNT). + setNodeFilter(new TestCacheNodeExcludingFilter(testNodeName(0)))); + + final Map<Integer, Integer> vals = new HashMap(); + + for (int i = 0; i < 100; i++) + vals.put(i, i); + + try (Transaction tx = client.transactions().txStart(PESSIMISTIC, REPEATABLE_READ)) { + cache.putAll(vals); + + tx.commit(); + } + + final TestRecordingCommunicationSpi clientSpi = TestRecordingCommunicationSpi.spi(client); + + clientSpi.blockMessages(new IgniteBiPredicate<ClusterNode, Message>() { + @Override public boolean apply(ClusterNode node, Message msg) { + return msg instanceof GridNearGetRequest; + } + }); + + IgniteInternalFuture getFut = GridTestUtils.runAsync(new Callable() { + @Override public Object call() throws Exception { + cache.getAll(vals.keySet()); + + return null; + } + }, "get-thread"); + + clientSpi.waitForBlocked(); + + stopGrid(0); + + stopGrid(client.name()); + + try { + getFut.get(); + + fail(); + } + catch (Exception ignore) { + // No-op. + } + + for (Ignite node : G.allGrids()) + checkActiveQueriesCleanup(node); + } + + /** + * @throws Exception If failed. + */ public void testReadInProgressCoordinatorFails() throws Exception { readInProgressCoordinatorFails(false); }
