flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #5062: [FLINK-7880][QS] Wait for proper resource cleanup ...
Date Wed, 29 Nov 2017 14:41:05 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5062#discussion_r153790485
  
    --- Diff: flink-queryable-state/flink-queryable-state-runtime/src/test/java/org/apache/flink/queryablestate/network/AbstractServerTest.java
---
    @@ -86,77 +83,89 @@ public void testServerInitializationFailure() throws Throwable {
     	 */
     	@Test
     	public void testPortRangeSuccess() throws Throwable {
    -		TestServer server1 = null;
    -		TestServer server2 = null;
    -		Client<TestMessage, TestMessage> client = null;
     
    -		try {
    -			server1 = startServer("Test Server 1", 7777, 7778, 7779);
    +		// this is shared between the two servers.
    +		AtomicKvStateRequestStats serverStats = new AtomicKvStateRequestStats();
    +		AtomicKvStateRequestStats clientStats = new AtomicKvStateRequestStats();
    +
    +		List<Integer> portList = new ArrayList<>();
    +		portList.add(7777);
    +		portList.add(7778);
    +		portList.add(7779);
    +
    +		try (
    +				TestServer server1 = new TestServer("Test Server 1", serverStats, portList.iterator());
    +				TestServer server2 = new TestServer("Test Server 2", serverStats, portList.iterator());
    +				TestClient client = new TestClient(
    +						"Test Client",
    +						1,
    +						new MessageSerializer<>(new TestMessage.TestMessageDeserializer(), new TestMessage.TestMessageDeserializer()),
    +						clientStats
    +				)
    +		) {
    +			server1.start();
     			Assert.assertEquals(7777L, server1.getServerAddress().getPort());
     
    -			server2 = startServer("Test Server 2", 7777, 7778, 7779);
    +			server2.start();
     			Assert.assertEquals(7778L, server2.getServerAddress().getPort());
    --- End diff --
    
    same as above


---

Mime
View raw message