Skip to content

Commit 58292a0

Browse files
authored
[hotfix] Don't print waiting info in waitForNextWithTimeout & try to fix unstable testCreateAlreadyExistsLakeTable (apache#1650)
1 parent 5f61f47 commit 58292a0

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/catalog/FlinkCatalogTest.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -272,24 +272,20 @@ void testCreateAlreadyExistsLakeTable() throws Exception {
272272
Map<String, String> options = new HashMap<>();
273273
options.put(TABLE_DATALAKE_ENABLED.key(), "true");
274274
options.put(TABLE_DATALAKE_FORMAT.key(), PAIMON.name());
275-
assertThatThrownBy(() -> catalog.getTable(tableInDefaultDb))
276-
.isInstanceOf(TableNotExistException.class)
277-
.hasMessage(
278-
String.format(
279-
"Table (or view) %s does not exist in Catalog %s.",
280-
tableInDefaultDb, CATALOG_NAME));
275+
276+
ObjectPath lakeTablePath = new ObjectPath(DEFAULT_DB, "lake_table");
281277
CatalogTable table = this.newCatalogTable(options);
282-
catalog.createTable(this.tableInDefaultDb, table, false);
283-
assertThat(catalog.tableExists(this.tableInDefaultDb)).isTrue();
278+
catalog.createTable(lakeTablePath, table, false);
279+
assertThat(catalog.tableExists(lakeTablePath)).isTrue();
284280
// drop fluss table
285-
catalog.dropTable(this.tableInDefaultDb, false);
281+
catalog.dropTable(lakeTablePath, false);
286282
// create the table again, should throw exception with ignore if exist = false
287-
assertThatThrownBy(() -> catalog.createTable(this.tableInDefaultDb, table, false))
283+
assertThatThrownBy(() -> catalog.createTable(lakeTablePath, table, false))
288284
.isInstanceOf(CatalogException.class)
289285
.hasMessage(
290286
String.format(
291287
"The table %s already exists in %s catalog, please first drop the table in %s catalog or use a new table name.",
292-
this.tableInDefaultDb, "paimon", "paimon"));
288+
lakeTablePath, "paimon", "paimon"));
293289
}
294290

295291
@Test

fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/source/testutils/FlinkRowAssertionsUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,9 @@ private static AssertionError timeoutError(
164164
private static boolean waitForNextWithTimeout(
165165
CloseableIterator<Row> iterator, long maxWaitTime) {
166166
CompletableFuture<Boolean> future = CompletableFuture.supplyAsync(iterator::hasNext);
167-
System.out.println("Waiting for " + maxWaitTime + " ms to finish.");
168167
try {
169168
return future.get(maxWaitTime, TimeUnit.MILLISECONDS);
170169
} catch (TimeoutException e) {
171-
System.err.println("Timeout waiting for " + maxWaitTime + " ms to finish.");
172170
future.cancel(true);
173171
return false;
174172
} catch (Exception e) {

0 commit comments

Comments
 (0)