Skip to content

Commit e8013a6

Browse files
committed
deployment watcher: refactoring testing
While investigating whether the deploymentwatcher would need updates to implement system deployments, I discovered that some of the tests are racy and make assertions about called functions without waiting. Update these tests to wait where needed, and generally clean them up while we're in here. Ref: https://hashicorp.atlassian.net/browse/NMD-892
1 parent 3ca518e commit e8013a6

File tree

3 files changed

+320
-540
lines changed

3 files changed

+320
-540
lines changed

nomad/deploymentwatcher/deployment_watcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (w *deploymentWatcher) getDeployment() *structs.Deployment {
156156
return w.d
157157
}
158158

159-
func (w *deploymentWatcher) SetAllocHealth(
159+
func (w *deploymentWatcher) setAllocHealth(
160160
req *structs.DeploymentAllocHealthRequest,
161161
resp *structs.DeploymentUpdateResponse) error {
162162

nomad/deploymentwatcher/deployments_watcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ func (w *Watcher) SetAllocHealth(req *structs.DeploymentAllocHealthRequest, resp
374374
return err
375375
}
376376

377-
return watcher.SetAllocHealth(req, resp)
377+
return watcher.setAllocHealth(req, resp)
378378
}
379379

380380
// PromoteDeployment is used to promote a deployment. If promote is false,

0 commit comments

Comments
 (0)