vlsi commented on a change in pull request #1375:
[WIP][CALCITE-3140][CALCITE-3141] Failures in slow tests & CI
URL: https://github.com/apache/calcite/pull/1375#discussion_r349269635
##########
File path: core/src/test/java/org/apache/calcite/test/FoodmartTest.java
##########
@@ -122,64 +112,45 @@
for (Integer id : IntegerIntervalSet.of(idList)) {
final FoodMartQuerySet.FoodmartQuery query1 = set.queries.get(id);
if (query1 != null) {
- list.add(new Object[] {id /*, query1.sql */});
+ list.add(query1);
}
}
} else {
for (FoodMartQuerySet.FoodmartQuery query1 : set.queries.values()) {
- if (!CalciteSystemProperty.TEST_SLOW.value() && query1.id != 2) {
- // If slow queries are not enabled, only run query #2.
- continue;
- }
if (Primitive.asList(DISABLED_IDS).contains(query1.id)) {
continue;
}
- list.add(new Object[]{query1.id /*, query1.sql */});
+ list.add(query1);
}
}
- return list;
+ return list.stream();
}
- public FoodmartTest(int id) throws IOException {
- if (id < 0) {
- this.query = new FoodMartQuerySet.FoodmartQuery();
- query.id = id;
- query.sql = "select * from (values 1) as t(c)";
- } else {
- this.query = FoodMartQuerySet.instance().queries.get(id);
- }
- assert query.id == id : id + ":" + query.id;
- }
-
- @Test(timeout = 60000)
- public void test() {
- try {
+ @ParameterizedTest
+ @MethodSource("org.apache.calcite.test.FoodmartTest#queries")
+ public void test(FoodMartQuerySet.FoodmartQuery query) {
+ Assertions.assertTimeoutPreemptively(Duration.ofMinutes(2), () -> {
CalciteAssert.that()
- .with(CalciteAssert.Config.FOODMART_CLONE)
- .pooled()
- .query(query.sql)
- .runs();
- } catch (Throwable e) {
- throw new RuntimeException("Test failed, id=" + query.id + ", sql="
- + query.sql, e);
- }
+ .with(CalciteAssert.Config.FOODMART_CLONE)
+ .pooled()
+ .query(query.sql)
+ .runs();
+ });
}
- @Test(timeout = 60000)
- @Ignore
- public void testWithLattice() {
- try {
+ @ParameterizedTest
+ @Disabled
+ @MethodSource("org.apache.calcite.test.FoodmartTest#queries")
Review comment:
It could be just `@MethodSource("queries")`
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services