flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] zhijiangW commented on a change in pull request #7822: [FLINK-11726][network] Refactor the creation of ResultPartition and InputGate into NetworkEnvironment
Date Tue, 30 Apr 2019 15:41:20 GMT
zhijiangW commented on a change in pull request #7822: [FLINK-11726][network] Refactor the
creation of ResultPartition and InputGate into NetworkEnvironment
URL: https://github.com/apache/flink/pull/7822#discussion_r279814078
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskTest.java
 ##########
 @@ -251,14 +262,9 @@ public void testExecutionFailsInBlobsMissing() throws Exception {
 
 	@Test
 	public void testExecutionFailsInNetworkRegistration() throws Exception {
-		// mock a network manager that rejects registration
-		final ResultPartitionManager partitionManager = mock(ResultPartitionManager.class);
 		final ResultPartitionConsumableNotifier consumableNotifier = new NoOpResultPartitionConsumableNotifier();
 		final PartitionProducerStateChecker partitionProducerStateChecker = mock(PartitionProducerStateChecker.class);
-
-		final NetworkEnvironment network = mock(NetworkEnvironment.class);
-		when(network.getResultPartitionManager()).thenReturn(partitionManager);
-		doThrow(new RuntimeException("buffers")).when(network).registerTask(any(Task.class));
+		final NetworkEnvironment network = new NetworkEnvironmentBuilder().build();
 
 Review comment:
   Yes, you are right when I double check the codes. I thought this `NetworkEnvironment` is
created only once for all the tests. It should be no problem to create new one for each test.
I would fix it now.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message