yuqi1129 opened a new issue, #12248:
URL: https://github.com/apache/gravitino/issues/12248
### Version
main branch
### Describe what's wrong
`CatalogKafkaIT.testNameSpec` fails intermittently in CI.
After `dropTopic` returns, the test immediately checks `topicExists`. Kafka
topic deletion is asynchronous, so the topic may still be visible briefly and
the assertion observes stale metadata.
### Error message and/or stacktrace
```text
CatalogKafkaIT > testNameSpec() FAILED
org.opentest4j.AssertionFailedError: expected: <false> but was: <true>
at
org.apache.gravitino.catalog.kafka.integration.test.CatalogKafkaIT.testNameSpec(CatalogKafkaIT.java:453)
```
Failed job:
https://github.com/apache/gravitino/actions/runs/30437817249/job/90530284931
### How to reproduce
Run the test repeatedly with Docker tests enabled:
`./gradlew :catalogs:catalog-kafka:test --tests
org.apache.gravitino.catalog.kafka.integration.test.CatalogKafkaIT.testNameSpec
-PskipDockerTests=false --rerun-tasks`
The test may intermittently fail at the assertion immediately following
`dropTopic`.
### Additional context
A similar timing issue was fixed for `testDropTopic` in #11015 and #11016 by
waiting for Kafka metadata convergence with Awaitility. However, the final
deletion assertion in `testNameSpec` was not covered.
Possible solutions:
- Reuse `awaitTopicDeletedInKafka` before asserting that the topic no longer
exists.
- Use Awaitility to poll `topicExists` until it returns false.
- Adjust the test to avoid relying on immediate visibility after Kafka topic
deletion.
--
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]