gnodet opened a new pull request, #29506:
URL: https://github.com/apache/camel/pull/29506
## Summary
Three Couchbase integration tests were failing due to two root causes.
## Root Cause 1 — Tag/execution mismatch in pom.xml
`ConsumeMessagesWithLimitIT` and `ConsumeResumeStrategyIT` are tagged
`@Tag("couchbase-71")` to run against Couchbase 7.1.5 (the last version that
supports MapReduce Views). However the failsafe execution in `pom.xml` defined
the group as `couchbase-7` (without the `1`), so these tests fell through to
the **default** `integration-test` execution which runs against Couchbase 8.0.3
— where MapReduce Views are deprecated and return 0 results instead of the
expected 10.
**Fix**: Rename the `<id>couchbase-7</id>` execution and its
`<groups>`/`<excludedGroups>` to `couchbase-71` to match the actual JUnit 5 tag
used by the tests.
## Root Cause 2 — Query service not ready before `createPrimaryIndex`
`ConsumeSqlQueryIT.setUpCouchbase()` called `Cluster.connect()` and
immediately proceeded to create a bucket and call
`cluster.queryIndexes().createPrimaryIndex()`. The
`cluster.bucket(name).waitUntilReady()` only waits for the KV service to become
available; the query service may still be starting up at that point, causing
`ServiceNotAvailableException`.
**Fix**: Add `cluster.waitUntilReady(Duration.ofSeconds(30))` at cluster
level immediately after `Cluster.connect()` to ensure all services (including
query) are ready before proceeding.
## Bonus fix — Discarded waitUntilReady in CouchbaseIntegrationTestBase
`CouchbaseIntegrationTestBase.setUpCouchbase()` called
`cluster.bucket(bucketName)` but discarded the return value (a no-op) instead
of calling `waitUntilReady()` on it. This meant `upsertDesignDocument()` could
race against bucket KV startup.
**Fix**: Chain `.waitUntilReady(Duration.ofSeconds(30))` on the
`cluster.bucket(bucketName)` call.
## Files Changed
- `components/camel-couchbase/pom.xml` — align execution group names with
`couchbase-71` tag
- `ConsumeSqlQueryIT.java` — add cluster-level `waitUntilReady` after connect
- `CouchbaseIntegrationTestBase.java` — fix discarded bucket `waitUntilReady`
---
_Hermes Agent on behalf of gnodet_
--
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]