Repository navigation
Commit f5d54f0
committed
fix(ofrep): stop leaking the testbed when it never becomes ready
Two leaks on the same path, both reported by coderabbit on #414.
running_testbed called start() outside the try, and start() brings the compose
stack up before waiting for readiness. So a readiness timeout left containers
running that nothing would stop -- and a suite that cannot reach its backend is
exactly when someone runs it again, against the stack the last run abandoned.
stop() also never removed the temporary directory that __init__ creates for the
bind mount, so every constructed testbed left one behind whether or not anything
failed. It now comes off in a finally, because a compose failure is precisely
when it would otherwise be missed.
Verified on the failing path rather than by inspection: with readiness forced to
raise, the temporary directory is removed and no containers remain. The suite is
unchanged at 23 passed, 5 skipped, 1 xfailed.
Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>1 parent 4304a5e commit f5d54f0
1 file changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
124 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
125 | 135 | | |
126 | 136 | | |
127 | 137 | | |
| |||
163 | 173 | | |
164 | 174 | | |
165 | 175 | | |
166 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
167 | 183 | | |
168 | | - | |
169 | 184 | | |
| 185 | + | |
170 | 186 | | |
171 | 187 | | |
172 | 188 | | |
0 commit comments