You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "MehulBatra (via GitHub)" <gi...@apache.org> on 2025/09/03 20:07:10 UTC
Re: [PR] [test/flink] Collect flink rows should always be with timeout [fluss]
MehulBatra commented on code in PR #1622:
URL: https://github.com/apache/fluss/pull/1622#discussion_r2320064012
##########
fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/source/testutils/FlinkRowAssertionsUtils.java:
##########
@@ -62,42 +66,45 @@ public static void assertQueryResultExactOrder(
}
}
- private static List<String> collectRowsWithTimeout(
+ public static List<String> collectRowsWithTimeout(
+ CloseableIterator<Row> iterator, int expectedCount) {
+ return collectRowsWithTimeout(iterator, expectedCount, true);
+ }
+
+ public static List<String> collectRowsWithTimeout(
CloseableIterator<Row> iterator, int expectedCount, boolean closeIterator) {
- List<String> actual = new ArrayList<>();
- long startTime = System.currentTimeMillis();
- int maxWaitTime = 60000; // 60 seconds
+ return collectRowsWithTimeout(
+ iterator,
+ expectedCount,
+ closeIterator,
+ // max wait 1 minute
+ Duration.ofMinutes(1));
+ }
+ protected static List<String> collectRowsWithTimeout(
Review Comment:
Would be beneficial for fail-fast validation, prevents confusing downstream errors, what do you think?
```
if (expectedCount < 0) {
throw new IllegalArgumentException("Expected count must be non-negative: " + expectedCount);
}
if (iterator == null) {
throw new IllegalArgumentException("Iterator cannot be null");
}
```
--
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.
To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org