Commit 9e9ede2
committed
fix: resolve StopIteration error in BigQuery emulator fixture
Fixes a RuntimeError caused by StopIteration being raised inside a
generator function when Docker container ports cannot be found.
Changes:
- Move container.reload() to the start of retry loop to ensure fresh
port bindings are available
- Replace unsafe next() call with explicit dict.get() for exact-key
port matching (e.g., "9050/tcp" instead of startswith pattern)
- Add descriptive error message showing available ports when lookup fails
- Use RuntimeError instead of allowing StopIteration to propagate
This fix ensures all database services (including BigQuery emulator)
can properly start their Docker containers and expose ports reliably.
Resolves issue where BigQuery tests failed with:
"RuntimeError: generator raised StopIteration"1 parent cf7b9fe commit 9e9ede2
2 files changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
| 98 | + | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
0 commit comments