Skip to content

Commit ea5fc85

Browse files
committed
[FLINK-35095][test] Fix unstable tests in ExecutionEnvironmentImplTest
1 parent a021082 commit ea5fc85

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: flink-datastream/src/test/java/org/apache/flink/datastream/impl/ExecutionEnvironmentImplTest.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ void testFromSource() {
9393
Collection<StreamNode> nodes = streamGraph.getStreamNodes();
9494
assertThat(nodes).hasSize(2);
9595
Collection<Integer> sourceIDs = streamGraph.getSourceIDs();
96-
StreamNode sourceNode = nodes.iterator().next();
97-
assertThat(sourceIDs).containsExactly(sourceNode.getId());
96+
for (StreamNode node : nodes) {
97+
if (node.getOperatorName().contains("source")) {
98+
assertThat(sourceIDs).containsExactly(node.getId());
99+
}
100+
}
98101
}
99102

100103
@Test
@@ -118,7 +121,10 @@ public void processRecord(
118121
StreamGraph streamGraph = StreamTestUtils.getStreamGraph(env);
119122
Collection<StreamNode> nodes = streamGraph.getStreamNodes();
120123
Collection<Integer> sourceIDs = streamGraph.getSourceIDs();
121-
StreamNode sourceNode = nodes.iterator().next();
122-
assertThat(sourceIDs).containsExactly(sourceNode.getId());
124+
for (StreamNode node : nodes) {
125+
if (node.getOperatorName().contains("source")) {
126+
assertThat(sourceIDs).containsExactly(node.getId());
127+
}
128+
}
123129
}
124130
}

0 commit comments

Comments
 (0)