zhuzhurk commented on a change in pull request #10832: 
[FLINK-14163][runtime]Enforce synchronous registration of 
Execution#producedPartitions
URL: https://github.com/apache/flink/pull/10832#discussion_r365729537
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/ExecutionTest.java
 ##########
 @@ -540,6 +557,65 @@ public void testSlotReleaseAtomicallyReleasesExecution() 
throws Exception {
                });
        }
 
+       /**
+        * Tests that producedPartitions are registered synchronously under an 
asynchronous interface.
+        */
+       @Test(expected = IllegalStateException.class)
+       public void testSynchronousRegisterProducedPartitions() throws 
Exception {
+               ExecutionJobVertex jobVertex = getExecutionVertex(
+                               new JobVertexID(),
+                               new DirectScheduledExecutorService(),
+                               EAGER);
+               IntermediateResult result =
+                               new IntermediateResult(new 
IntermediateDataSetID(), jobVertex, 1, ResultPartitionType.PIPELINED);
+               ExecutionVertex vertex =
+                               new ExecutionVertex(jobVertex, 0, new 
IntermediateResult[]{result}, Time.minutes(1));
+               ExecutionEdge edge = createMockExecutionEdge(1);
+               result.getPartitions()[0].addConsumerGroup();
+               result.getPartitions()[0].addConsumer(edge, 0);
+               TaskManagerLocation location =
+                               new TaskManagerLocation(ResourceID.generate(), 
InetAddress.getLoopbackAddress(), 1);
+               ExecutionAttemptID attemptID = new ExecutionAttemptID();
+               Execution.registerProducedPartitions(vertex, location, 
attemptID, EAGER.allowLazyDeployment());
+       }
+
+       @Nonnull
+       private ExecutionJobVertex getExecutionVertex(
 
 Review comment:
   Could we extend ExecutionGraphTestUtils#getExecutionVertex(...) to customize 
shuffleMaster and reuse it?

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to