Skip to content

Commit f070f0d

Browse files
akalashdawidwys
authored andcommitted
[FLINK-24331][tests] Forbid to finish the TestEventSource if it has not sent at least one value
1 parent 63bd6a3 commit f070f0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flink-tests/src/test/java/org/apache/flink/runtime/operators/lifecycle/graph/TestEventSource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public void open(Configuration parameters) throws Exception {
7373
public void run(SourceContext<TestDataElement> ctx) {
7474
long lastSent = 0;
7575
while (isRunning) {
76-
TestCommand cmd = scheduledCommands.poll();
76+
// Don't finish the source if it has not sent at least one value.
77+
TestCommand cmd = lastSent == 0 ? null : scheduledCommands.poll();
7778
if (cmd == FINISH_SOURCES) {
7879
ack(cmd);
7980
isRunning = false;

0 commit comments

Comments
 (0)