Source:
<code>private void runTxOnCacheStop(TransactionConcurrency conc, TransactionIsolation iso, Ignite ig, boolean runConc) throws Exception { if ((conc == TransactionConcurrency.OPTIMISTIC) && (MvccFeatureChecker.forcedMvcc())) return; CountDownLatch destroyLatch = new CountDownLatch(1); final IgniteCache<Integer, byte[]> cache = ig.getOrCreateCache(destroyCacheCfg); final IgniteCache<Integer, byte[]> cache2 = ig.getOrCreateCache(surviveCacheCfg); TestRecordingCommunicationSpi spi = TestRecordingCommunicationSpi.spi(ig); IgniteInternalFuture f0 = GridTestUtils.runAsync(() -> { try { destroyLatch.await(); <START> IgniteInternalFuture fInt = GridTestUtils.runAsync(() -> { <END> try { U.sleep(rnd.nextInt(500)); } catch (IgniteInterruptedCheckedException e) { } spi.stopBlock(); }); cache.destroy(); fInt.get(); } catch (Exception e) { e.printStackTrace(); } }); spi.blockMessages((node, msg) -> { if (msg instanceof GridNearTxPrepareRequest) { destroyLatch.countDown(); return runConc; } return false; }); IgniteInternalFuture f1 = GridTestUtils.runAsync(() -> { byte[] val = new byte[1024]; try (Transaction tx = ig.transactions().txStart(conc, iso, 1_000, 2)) { try { cache.put(100, val); cache2.put(100, val); } catch (IgniteCacheRestartingException e) { e.restartFuture().get(); } tx.commit(); } catch (IgniteException e) { assertTrue(X.hasCause(e, IgniteTxTimeoutCheckedException.class) || X.hasCause(e, CacheInvalidStateException.class) || X.hasCause(e, IgniteException.class)); } }); f1.get(); f0.get(); try { assertTrue(cache2.get(100) == cache.get(100)); } catch (IllegalStateException e) { assertTrue(X.hasCause(e, CacheStoppedException.class)); } spi.stopBlock(); }</code><technical_language>fInt? f better</technical_language>

Target:
private void runTxOnCacheStop(TransactionConcurrency conc, TransactionIsolation iso, Ignite ig, boolean runConc) throws Exception { if ((conc == TransactionConcurrency.OPTIMISTIC) && (MvccFeatureChecker.forcedMvcc())) return; CountDownLatch destroyLatch = new CountDownLatch(1); final IgniteCache<Integer, byte[]> cache = ig.getOrCreateCache(destroyCacheCfg); final IgniteCache<Integer, byte[]> cache2 = ig.getOrCreateCache(surviveCacheCfg); TestRecordingCommunicationSpi spi = TestRecordingCommunicationSpi.spi(ig); IgniteInternalFuture f0 = GridTestUtils.runAsync(() -> { try { destroyLatch.await(); IgniteInternalFuture f = GridTestUtils.runAsync(() -> { doSleep(rnd.nextInt(500)); spi.stopBlock(); }); cache.destroy(); f.get(); } catch (Exception e) { e.printStackTrace(); } }); spi.blockMessages((node, msg) -> { if (msg instanceof GridNearTxPrepareRequest) { destroyLatch.countDown(); return runConc; } return false; }); IgniteInternalFuture f1 = GridTestUtils.runAsync(() -> { byte[] val = new byte[1024]; try (Transaction tx = ig.transactions().txStart(conc, iso, 1_000, 2)) { cache.put(100, val); cache2.put(100, val); tx.commit(); } catch (IgniteException e) { assertTrue(X.hasCause(e, IgniteTxTimeoutCheckedException.class) || X.hasCause(e, CacheInvalidStateException.class) || X.hasCause(e, IgniteException.class)); } }); f1.get(); f0.get(); try { assertEquals(cache2.get(100), cache.get(100)); } catch (IllegalStateException e) { assertTrue(X.hasCause(e, CacheStoppedException.class)); } spi.stopBlock(); }