I am writing a script for my Couchbase deployment that I have to test. Writing the tests requires destroying and recreating a local cluster a few times.
The script uses at some point a few n1ql queries (using the Go SDK) to manage indexes. However, the test randomly fails on this step with a “service not available” error. This is especially problematic because it occurs randomly on around half of the tests.
I have confirmed the error comes from the following instruction:
Which is by the way the only moment I user the Query method in my whole scripts.
I noticed the error rarely occurs on first run, and became less present when adding a long cooldown after destroying the cluster (I didn’t got significantly better results above a 60 seconds cooldown, which still make the test fails quite a few times).
Is their a solution to ensure the Couchbase Server app is totally shutdown and can be safely restarted ? Or any other way to prevent this failure from happening ?
My environment :
macOS Big Sur 11.1
Couchbase Server Community Edition 6.6.0-7909 (app, not Docker)
The command which is failing runs close after those steps. I have also confirmed that everything works fine until then (the cluster is up, with the correct credentials/resources/buckets, accessible through web UI).