This is an automated email from the ASF dual-hosted git repository.
yuqi1129 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new bff141888c [#13286] test(trino-connector): Fix flaky test
testCatalogStatusReportsARegistrationFailure (#13287)
bff141888c is described below
commit bff141888cbf0843168c5c9e564d9bbb8a3cd036
Author: Yuhui <[email protected]>
AuthorDate: Fri Sep 18 09:42:30 2026 +0800
[#13286] test(trino-connector): Fix flaky test
testCatalogStatusReportsARegistrationFailure (#13287)
### What changes were proposed in this pull request?
Assert `failure_count >= 1` instead of `== 1` in
`testCatalogStatusReportsARegistrationFailure`.
### Why are the changes needed?
The catalog load loop retries failed catalogs on every metadata refresh
and increments `failure_count` each time. A refresh landing between
`create_catalog` and the `catalog_status` query makes the count 2, so
the exact assertion is timing dependent. The test only needs to verify
the failure is reported.
Fix: #13286
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Ran
`TestGravitinoConnector446$SingleMetalake.testCatalogStatusReportsARegistrationFailure`
locally.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5 <[email protected]>
---
.../org/apache/gravitino/trino/connector/TestGravitinoConnector.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/trino-connector/trino-connector/src/test/java/org/apache/gravitino/trino/connector/TestGravitinoConnector.java
b/trino-connector/trino-connector/src/test/java/org/apache/gravitino/trino/connector/TestGravitinoConnector.java
index 9d889c5dc3..b1d9465ba1 100644
---
a/trino-connector/trino-connector/src/test/java/org/apache/gravitino/trino/connector/TestGravitinoConnector.java
+++
b/trino-connector/trino-connector/src/test/java/org/apache/gravitino/trino/connector/TestGravitinoConnector.java
@@ -387,7 +387,9 @@ public abstract class TestGravitinoConnector extends
AbstractGravitinoConnectorT
MaterializedRow row = result.getMaterializedRows().get(0);
assertEquals(row.getField(0), "FAILED");
assertThat((String) row.getField(1)).contains("unknown-direct-key");
- assertEquals(row.getField(2), 1L);
+ // The load loop retries failed catalogs on every metadata refresh, so a
refresh that lands
+ // between the procedure call and this query bumps the count past the
initial failure.
+ assertThat((Long) row.getField(2)).isGreaterThanOrEqualTo(1L);
} finally {
// Leave the shared query runner as it was found, or the load loop keeps
retrying this catalog
// and the other status table tests see an extra row.