Commit d1a3d89
committed
Update TestContext_sleepTimeoutExpired to check for canceling within timeframe
Add a timeout to the test to ensure that the terraform apply cancels within
a reasonable time of the 5s timeout.
Currently, this test is not canceling the terraform apply as expected. In the
logs you can see that the test takes 1 min rather than ~5s:
```
--- PASS: TestContext_sleepTimeoutExpired/sleep-0.12.31 (62.13s)
```
```
=== RUN TestContext_sleepTimeoutExpired/sleep-0.12.31
util_test.go:113: [INFO] running Terraform command: /var/folders/6y/gy9gggt14379c_k39vwb50lc0000gn/T/terraform_1378921380/terraform apply -no-color -auto-approve -input=false -lock=true -parallelism=10 -refresh=true
util_test.go:103: CLI Output:
// truncated ...
time_sleep.sleep: Creating...
time_sleep.sleep: Still creating... [10s elapsed]
time_sleep.sleep: Still creating... [20s elapsed]
time_sleep.sleep: Still creating... [30s elapsed]
time_sleep.sleep: Still creating... [41s elapsed]
time_sleep.sleep: Still creating... [51s elapsed]
time_sleep.sleep: Creation complete after 1m0s [id=2022-05-06T17:40:20Z]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
```1 parent 7b1dddd commit d1a3d89
1 file changed
+15
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
| |||
0 commit comments