Source:
<code>public void testTableViewDuringRebuilding() throws Exception { isPersistenceEnabled = true; IgniteEx srv = startGrid(getConfiguration()); srv.cluster().active(true); String cacheName1 = "CACHE_1"; String cacheSqlName1 = "SQL_PUBLIC_" + cacheName1; String cacheName2 = "CACHE_2"; String cacheSqlName2 = "SQL_PUBLIC_" + cacheName2; execSql("CREATE TABLE " + cacheName1 + " (ID1 INT PRIMARY KEY, MY_VAL VARCHAR)"); execSql("CREATE INDEX IDX_1 ON "+ cacheName1 + " (MY_VAL DESC)"); execSql("CREATE TABLE " + cacheName2 + " (ID INT PRIMARY KEY, MY_VAL VARCHAR)"); execSql("CREATE INDEX IDX_2 ON " + cacheName2 + " (ID DESC)"); execSql("INSERT INTO " + cacheName1 + " VALUES(?, ?)", 1, "12345"); execSql("INSERT INTO " + cacheName2 + " VALUES(?, ?)", 1, "12345"); List<Path> idxPaths = getIndexBinPaths(cacheSqlName1); idxPaths.addAll(getIndexBinPaths(cacheSqlName2)); stopAllGrids(); idxPaths.forEach(idxPath -> assertTrue(U.delete(idxPath))); GridQueryProcessor.idxCls = BlockingIndexing.class; srv = startGrid(getConfiguration()); srv.cluster().active(true); checkIndexRebuild(cacheName1, true); checkIndexRebuild(cacheName2, true); ((BlockingIndexing)srv.context().query().getIndexing()).stopBlock(cacheSqlName1); <START> srv.cache(cacheSqlName1).indexReadyFuture().get(); <END> checkIndexRebuild(cacheName1, false); checkIndexRebuild(cacheName2, true); ((BlockingIndexing)srv.context().query().getIndexing()).stopBlock(cacheSqlName2); srv.cache(cacheSqlName2).indexReadyFuture().get(); checkIndexRebuild(cacheName1, false); checkIndexRebuild(cacheName2, false); }</code><technical_language>perform get some timeout prevent test hanging</technical_language>

Target:
public void testTableViewDuringRebuilding() throws Exception { isPersistenceEnabled = true; IgniteEx srv = startGrid(getConfiguration()); srv.cluster().active(true); String cacheName1 = "CACHE_1"; String cacheSqlName1 = "SQL_PUBLIC_" + cacheName1; String cacheName2 = "CACHE_2"; String cacheSqlName2 = "SQL_PUBLIC_" + cacheName2; execSql("CREATE TABLE " + cacheName1 + " (ID1 INT PRIMARY KEY, MY_VAL VARCHAR)"); execSql("CREATE INDEX IDX_1 ON "+ cacheName1 + " (MY_VAL DESC)"); execSql("CREATE TABLE " + cacheName2 + " (ID INT PRIMARY KEY, MY_VAL VARCHAR)"); execSql("CREATE INDEX IDX_2 ON " + cacheName2 + " (ID DESC)"); execSql("INSERT INTO " + cacheName1 + " VALUES(?, ?)", 1, "12345"); execSql("INSERT INTO " + cacheName2 + " VALUES(?, ?)", 1, "12345"); List<Path> idxPaths = getIndexBinPaths(cacheSqlName1); idxPaths.addAll(getIndexBinPaths(cacheSqlName2)); stopAllGrids(); idxPaths.forEach(idxPath -> assertTrue(U.delete(idxPath))); GridQueryProcessor.idxCls = BlockingIndexing.class; srv = startGrid(getConfiguration()); srv.cluster().active(true); checkIndexRebuild(cacheName1, true); checkIndexRebuild(cacheName2, true); ((BlockingIndexing)srv.context().query().getIndexing()).stopBlock(cacheSqlName1); srv.cache(cacheSqlName1).indexReadyFuture().get(30_000); checkIndexRebuild(cacheName1, false); checkIndexRebuild(cacheName2, true); ((BlockingIndexing)srv.context().query().getIndexing()).stopBlock(cacheSqlName2); srv.cache(cacheSqlName2).indexReadyFuture().get(30_000); checkIndexRebuild(cacheName1, false); checkIndexRebuild(cacheName2, false); }