Commit d256dd7
test(rabbitmq): bootstrap global CouchDB views in TestMain
Tests in this package call lifecycle.Create / instance.Get directly
without going through testutils.NewSetup → GetTestInstance →
stack.Start, so they never trigger couchdb.InitGlobalDB themselves.
They've historically relied on the side effect of earlier model/* test
packages bootstrapping the global DB and on the design doc persisting
in the shared CouchDB service across test binaries. Go's test result
cache (persisted via actions/setup-go cache) can let those packages be
skipped, breaking the implicit dependency. The CI flake on PR #4716
manifested as TestSyncCreatedOrgContact failing with
"CouchDB(not_found): missing" because instance.Service.Get queried
_design/domain-and-aliases on a global instances DB where that design
doc had never been created.
A more robust fix would be to make instance.Service.Get treat any
CouchDB "not_found" as ErrNotFound (it currently only handles
no_db_file / "Database does not exist."). That would remove the
implicit dependency for every package, not just this one. The
repercussions on other Get callers haven't been fully audited yet, so
this localized bootstrap stays in place until the broader change is
vetted.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a45dc6c commit d256dd7
1 file changed
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
0 commit comments