korlov42 commented on code in PR #7038:
URL: https://github.com/apache/ignite-3/pull/7038#discussion_r2559660610
##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/SqlTestUtils.java:
##########
@@ -596,6 +597,23 @@ public static void
waitUntilRunningQueriesCount(SqlQueryProcessor queryProcessor
Awaitility.await().untilAsserted(() ->
assertThat(queryProcessor.runningQueries().size(), matcher));
}
+ /**
+ * Waits until the number of queries in given phase matches the specified
matcher.
+ *
+ * @param queryProcessor The query processor to derive list of running
queries.
+ * @param phase The {@link ExecutionPhase} of the interest.
+ * @param matcher THe matcher to check the number of running queries.
+ * @throws AssertionError If after waiting the number of running queries
still does not match the specified matcher.
+ */
+ public static void waitUntilQueriesInPhaseCount(SqlQueryProcessor
queryProcessor, ExecutionPhase phase, Matcher<Integer> matcher) {
+ Awaitility.await().untilAsserted(() -> assertThat(
+ (int) queryProcessor.runningQueries().stream()
+ .filter(queryInfo -> queryInfo.phase() == phase)
+ .count(),
+ matcher
+ ));
Review Comment:
simplified, thanks!
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]