use of com.hazelcast.core.Hazelcast.newHazelcastInstance in project hazelcast by hazelcast.
the class NioChannelMemoryLeakTest method testNioChannelLeak.
@Test
public void testNioChannelLeak() {
Config config = getConfig();
config.setProperty(MERGE_NEXT_RUN_DELAY_SECONDS.getName(), "1");
config.setProperty(MERGE_FIRST_RUN_DELAY_SECONDS.getName(), "1");
HazelcastInstance instance = Hazelcast.newHazelcastInstance(config);
TcpServer networkingService = (TcpServer) getNode(instance).getServer();
final NioNetworking networking = (NioNetworking) networkingService.getNetworking();
assertTrueEventually(() -> assertThat(networking.getChannels(), Matchers.empty()));
}
Aggregations