Commit 2ef71ec
fix: make errInvalidComputeConfig non-retryable in deployment activities (#10127)
## Summary
- Changed `UpdateWorkerControllerInstanceFromDeployment` (activities.go)
and `UpdateWorkerControllerInstance` (version_activities.go) to return
`NewNonRetryableApplicationError` instead of `NewApplicationError` when
wrapping `InvalidArgument` errors from the WCI client
- Added functional test
`TestCreateWorkerDeploymentVersion_InvalidComputeConfig_ReturnsPromptly`
that verifies the error returns promptly when creating a version with
invalid compute config on a busy deployment
## Context
The `TestCreateWorkerDeploymentVersion_Errors` test in the CLI repo
(temporalio/cli) is flaky. When `create-version` is called with invalid
AWS Lambda credentials, the expected `"failed to assume role"` error is
sometimes replaced by `"too many requests"`.
Root cause: both activities wrap `InvalidArgument` errors as
**retryable** `ApplicationError`. The activity retries up to 5 times
(each attempt timing out trying to reach AWS IMDS), keeping the
deployment workflow busy. The deployment client's retry loop then times
out after 1 minute and `convertAndRecordError` masks the actual error as
`"too many requests"`.
The existing unit tests (`workflow_test.go:1543`,
`version_workflow_test.go:2383`) already mock the activity returning
`NewNonRetryableApplicationError` -- the activities just weren't
matching that expectation.
## Test plan
- [x] Existing unit tests pass (`go test
./service/worker/workerdeployment/...`)
- [x] Existing functional tests pass
(`TestCreateWorkerDeploymentVersion_InvalidScalingGroups`,
`TestCreateWorkerDeploymentVersion_InvalidArgs`)
- [x] New functional test passes 5/5 runs, consistently under 3 seconds
- [ ] Verify CLI `TestCreateWorkerDeploymentVersion_Errors` passes after
bumping server dependency
Co-authored-by: Jay Pipes <jaypipes@gmail.com>1 parent e004436 commit 2ef71ec
3 files changed
Lines changed: 48 additions & 2 deletions
File tree
- service/worker/workerdeployment
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
288 | | - | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3626 | 3626 | | |
3627 | 3627 | | |
3628 | 3628 | | |
| 3629 | + | |
| 3630 | + | |
| 3631 | + | |
| 3632 | + | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
| 3655 | + | |
| 3656 | + | |
| 3657 | + | |
| 3658 | + | |
| 3659 | + | |
| 3660 | + | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
3629 | 3675 | | |
3630 | 3676 | | |
3631 | 3677 | | |
| |||
0 commit comments