173174175176177178179180181
counter.inc(); bc.addEntry(addr, ledger, new byte[0], i, ChannelBuffers.wrappedBuffer(hello), cb, counter, 0); } counter.wait(0); System.out.println("Total = " + counter.total()); channelFactory.releaseExternalResources(); executor.shutdown(); } }
119120121122123124125126127128129
for (int j = i; j < 10; j++) { client.connectIfNeededAndDoOp(nullop); } client.close(); } channelFactory.releaseExternalResources(); executor.shutdown(); } /** * Test that all resources are freed if connections and disconnections
210211212213214215216217218219220
connectThread.join(); disconnectThread.join(); checkThread.join(); assertFalse("Failure in threads, check logs", shouldFail.get()); client.close(); channelFactory.releaseExternalResources(); executor.shutdown(); } /** * Test that requests are completed even if the channel is disconnected
275276277278279280281282283284285
}); Thread.sleep(1000); client.disconnect(); client.close(); channelFactory.releaseExternalResources(); executor.shutdown(); assertTrue("Request should have completed", completion.await(5, TimeUnit.SECONDS)); } }
8687888990919293949596
// we just want to trigger it connecting. } }); client.close(); } channelFactory.releaseExternalResources(); executor.shutdown(); } /** * Test race scenario found in {@link https://issues.apache.org/jira/browse/BOOKKEEPER-5}
275276277278279280281282283
170171172173174175176177178
counter.inc(); bc.addEntry(addr, ledger, new byte[0], i, ChannelBuffers.wrappedBuffer(hello), cb, counter); } counter.wait(0); System.out.println("Total = " + counter.total()); channelFactory.releaseExternalResources(); executor.shutdown(); } }
267268269270271272273274275
7374757677787980818283
106107108109110111112113114
for (int j = i; j < 10; j++) { client.connectIfNeededAndDoOp(nullop); } client.close(); } channelFactory.releaseExternalResources(); executor.shutdown(); } }