Commit f1eec2d
authored
fix(cli): scope context per subtest to fix flake test in prebuilt workspace delete (coder#18872)
## Description
This PR fixes a flaky test in
`TestDelete/Prebuilt_workspace_delete_permissions`:
coder/internal#764
Previously, all subtests used the same context created at the top level.
Since the subtests run in parallel, they could run for too long and
cause the shared context to expire. This sometimes led to context
deadline exceeded errors, especially during the `testutil.Eventually`
check for running prebuilt workspaces.
The fix is to create a fresh context per subtest, ensuring they are
isolated and not prematurely cancelled due to other subtests' durations.1 parent c643214 commit f1eec2d
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | 236 | | |
240 | 237 | | |
241 | 238 | | |
| |||
301 | 298 | | |
302 | 299 | | |
303 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
0 commit comments