Search in sources :

Example 1 with Hazelcast.newHazelcastInstance

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()));
}
Also used : HazelcastInstance(com.hazelcast.core.HazelcastInstance) Hazelcast.newHazelcastInstance(com.hazelcast.core.Hazelcast.newHazelcastInstance) Config(com.hazelcast.config.Config) JoinConfig(com.hazelcast.config.JoinConfig) TcpServer(com.hazelcast.internal.server.tcp.TcpServer) Test(org.junit.Test) SlowTest(com.hazelcast.test.annotation.SlowTest)

Aggregations

Config (com.hazelcast.config.Config)1 JoinConfig (com.hazelcast.config.JoinConfig)1 Hazelcast.newHazelcastInstance (com.hazelcast.core.Hazelcast.newHazelcastInstance)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 TcpServer (com.hazelcast.internal.server.tcp.TcpServer)1 SlowTest (com.hazelcast.test.annotation.SlowTest)1 Test (org.junit.Test)1