Repository navigation
Commit cb1496e
test(integration): close the container port race and stop reporting death as slowness
CORRECTION TO THE PREVIOUS COMMIT. I widened the readiness window to 120s on the
theory that the containers were merely slow under concurrent load. The next full
CI run failed with "did not become ready within 120s" -- a container that cannot
start in two minutes is not slow, so the diagnosis was wrong and the fix only
made the wrong answer take longer to arrive.
The real shape, and it is two bugs wearing one error message.
1. A PORT RACE. pickFreePort() opens a probe socket, closes it, and hands the
number to docker, which binds it LATER. Check-then-act. Running one port's
suite alone it never bites; a FULL CI run starts five ports' containers at
once and two can be handed the same number. The loser's container is created
and then dies.
2. A READINESS PROBE THAT CANNOT SEE DEATH. The loop only ever asked
`docker exec ... pg_isready`, which fails identically for "still booting" and
"exited ten seconds ago". So a container that died on startup burned the whole
window and reported a TIMEOUT -- naming a symptom, and one that reads as
slowness. Widening the window made this strictly worse: same wrong answer,
four times the wait.
`--rm` compounded it: an auto-removed container takes its logs with it, so the
single artefact that would explain the failure vanished exactly when it was
needed.
Fixed in all four ports, which each carried their own copy of the same loop:
- retry on a FRESH port (3 attempts), covering both the outright bind refusal
and the container that starts and dies
- drop `--rm` so a corpse survives; close()/stop() already force-remove
- fail FAST when docker reports the container is not running -- including
"gone", which with --rm was the common case -- and surface `docker logs`
- the timeout message now reports the container STATE and its logs, so a real
timeout is distinguishable from a death at a glance
The 120s window from the previous commit stays. It was not the fix, but it is
not wrong either: 30s was a guess, and the bound now only governs the case where
a container is genuinely alive and slow.
Verified: ApiContractConformanceTest -- the 26-scenario suite whose scenario[2]
failed in the last full run -- passes. java, kotlin and typescript integration
modules compile; python parses.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 0dc990b commit cb1496e
4 files changed
Lines changed: 302 additions & 55 deletions
File tree
- server
- java
- integration-tests-kotlin/src/test/kotlin/com/metaobjects/integration/kotlin
- integration-tests/src/test/java/com/metaobjects/integration
- python/tests/integration
- typescript/packages/integration-tests/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
69 | 101 | | |
70 | | - | |
71 | | - | |
72 | 102 | | |
73 | 103 | | |
74 | 104 | | |
| |||
99 | 129 | | |
100 | 130 | | |
101 | 131 | | |
102 | | - | |
| 132 | + | |
103 | 133 | | |
104 | 134 | | |
105 | 135 | | |
106 | 136 | | |
107 | 137 | | |
108 | 138 | | |
109 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
110 | 150 | | |
111 | 151 | | |
112 | 152 | | |
113 | 153 | | |
114 | | - | |
| 154 | + | |
115 | 155 | | |
116 | 156 | | |
117 | 157 | | |
| |||
122 | 162 | | |
123 | 163 | | |
124 | 164 | | |
125 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
126 | 169 | | |
127 | 170 | | |
128 | | - | |
129 | | - | |
| 171 | + | |
| 172 | + | |
130 | 173 | | |
131 | 174 | | |
132 | 175 | | |
133 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
134 | 196 | | |
135 | 197 | | |
136 | 198 | | |
137 | 199 | | |
138 | 200 | | |
139 | 201 | | |
140 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
141 | 206 | | |
142 | 207 | | |
143 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 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 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
90 | 123 | | |
91 | 124 | | |
92 | 125 | | |
| |||
154 | 187 | | |
155 | 188 | | |
156 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
157 | 193 | | |
158 | 194 | | |
159 | 195 | | |
160 | | - | |
| 196 | + | |
161 | 197 | | |
162 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
163 | 211 | | |
164 | 212 | | |
165 | 213 | | |
166 | | - | |
| 214 | + | |
167 | 215 | | |
168 | 216 | | |
169 | 217 | | |
170 | 218 | | |
171 | 219 | | |
172 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
173 | 240 | | |
174 | 241 | | |
175 | | - | |
176 | | - | |
| 242 | + | |
| 243 | + | |
177 | 244 | | |
178 | 245 | | |
179 | 246 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
71 | 101 | | |
72 | | - | |
73 | 102 | | |
74 | 103 | | |
75 | 104 | | |
| |||
144 | 173 | | |
145 | 174 | | |
146 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
147 | 198 | | |
148 | 199 | | |
149 | 200 | | |
150 | 201 | | |
151 | 202 | | |
152 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
153 | 214 | | |
154 | 215 | | |
155 | 216 | | |
| |||
166 | 227 | | |
167 | 228 | | |
168 | 229 | | |
169 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
170 | 233 | | |
171 | 234 | | |
172 | 235 | | |
| |||
0 commit comments