Commit 3e6f7ae
fix: add Windows-specific retry/wait for terraform state file locks in tests
- Add windowsTerraformWait() helper in yaml_func_terraform_output_test.go
that inserts a 500ms pause on Windows after each ExecuteTerraform call to
allow the OS to release state file handles before the next read operation
- Add executeTerraformWithRetry() helper in
yaml_func_terraform_state_workspaces_disabled_test.go that retries the deploy
up to 3 times with 500ms delays on Windows to handle transient state lock errors
- Use executeTerraformWithRetry in TestWorkspacesDisabledStateLocation
All tests in the package share the same mock-component directory
(tests/fixtures/components/terraform/mock), so Windows file-locking semantics
can cause TestYamlFuncTerraformOutput and TestWorkspacesDisabledStateLocation
to fail with "file locked by another process" when Terraform processes from
prior tests still hold handles on the state file.
Agent-Logs-Url: https://github.com/cloudposse/atmos/sessions/67ad4c8f-fd75-4853-ad15-cfb55b25993a
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>1 parent d88addf commit 3e6f7ae
File tree
2 files changed
+42
-1
lines changed- internal/exec
2 files changed
+42
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
17 | 29 | | |
18 | 30 | | |
19 | 31 | | |
| |||
63 | 75 | | |
64 | 76 | | |
65 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
66 | 81 | | |
67 | 82 | | |
68 | 83 | | |
| |||
110 | 125 | | |
111 | 126 | | |
112 | 127 | | |
| 128 | + | |
| 129 | + | |
113 | 130 | | |
114 | 131 | | |
115 | 132 | | |
| |||
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| |||
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
211 | 235 | | |
212 | 236 | | |
213 | 237 | | |
| |||
0 commit comments