azagrebin 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_r279729690
 
 

 ##########
 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:
   `setup` method should always recreate `networkEnvironment` for each test, so 
shutdown here should not affect other tests, right? 
   btw, `networkEnvironment` does not need to be static and does not seem to be 
used in any static context.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to