Commit 3a9d7b1
ci: fix flaky MongoDB "Connection refused" failures
The persistent-mongoDB test suite intermittently fails with
`Network.Socket.connect: ... does not exist (Connection refused)`.
Unlike postgres and mysql, which are declared as health-gated `services`
(the job blocks until they report healthy, and mysql has an extra explicit
connection check), MongoDB is started by an action step with no readiness
gate, and the test harness (MongoInit.runConn) connects once with no retry.
It was also started *before* the ~10 minute `cabal v2-build all`, leaving a
long window in which the mongod container could be resource-starved and
become unreachable by the time the tests ran.
- Move "Start MongoDB" to immediately before `cabal v2-test`, after the build.
- Add a readiness gate that waits for the port to accept connections (a plain
TCP check, mirroring the exact failure mode, with no mongo-client dependency).
- Bump supercharge/mongodb-github-action 1.8.0 -> 1.12.0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 855c20c commit 3a9d7b1
1 file changed
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
| |||
87 | 83 | | |
88 | 84 | | |
89 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
90 | 110 | | |
91 | 111 | | |
92 | 112 | | |
0 commit comments