Index: modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java (revision 4ba9c8e62072d0933f97ebc4335c7e6264657ab0) +++ modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/IgniteCacheContinuousQueryClientTest.java (revision 9a92b7f641ca3688a59c6c14411893d717a3c667) @@ -133,6 +133,60 @@ /** * @throws Exception If failed. */ + public void testNodeJoinsAutoUnsubscribeFalse() throws Exception { + startGrids(2); + + client = true; + + final int CLIENT_ID = 3; + + Ignite clientNode = startGrid(CLIENT_ID); + + client = false; + + final CacheEventListener lsnr = new CacheEventListener(); + + ContinuousQuery qry = new ContinuousQuery<>(); + + qry.setLocalListener(lsnr); + qry.setAutoUnsubscribe(false); + + QueryCursor cur = clientNode.cache(null).query(qry); + + for (int i = 0; i < 10; i++) { + log.info("Start iteration: " + i); + + lsnr.latch = new CountDownLatch(1); + + Ignite joined1 = startGrid(4); + + IgniteCache joinedCache1 = joined1.cache(null); + + joinedCache1.put(primaryKey(joinedCache1), 1); + + assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS)); + + lsnr.latch = new CountDownLatch(1); + + Ignite joined2 = startGrid(5); + + IgniteCache joinedCache2 = joined2.cache(null); + + joinedCache2.put(primaryKey(joinedCache2), 2); + + assertTrue("Failed to wait for event.", lsnr.latch.await(5, SECONDS)); + + stopGrid(4); + + stopGrid(5); + } + + cur.close(); + } + + /** + * @throws Exception If failed. + */ public void testNodeJoinsRestartQuery() throws Exception { startGrids(2); \ No newline at end of file