Skip to content

Commit

Permalink
fix(canary): fix wait task after baseline asg disable
Browse files Browse the repository at this point in the history
  • Loading branch information
asher committed Nov 3, 2017
1 parent 5ac3bf5 commit 8643fa2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class WaitTaskSpec extends Specification {

then:
result.status == ExecutionStatus.RUNNING
stage.context.putAll(result.context)
result.context.waitTaskState.startTime > 1
stage.context.putAll(result.context)

when:
timeProvider.millis = System.currentTimeMillis() + 10000
Expand All @@ -48,6 +49,7 @@ class WaitTaskSpec extends Specification {

then:
result.status == ExecutionStatus.SUCCEEDED
result.context.waitTaskState.size() == 0

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class WaitTask implements RetryableTask {
if (!waitTaskState || !waitTaskState instanceof Map) {
new TaskResult(RUNNING, [waitTaskState: [startTime: now]])
} else if (now - ((Long) ((Map) stage.context.waitTaskState).startTime) > waitTimeMs) {
new TaskResult(SUCCEEDED)
new TaskResult(SUCCEEDED, [waitTaskState: [:]])
} else if (stage.context.skipRemainingWait) {
new TaskResult(SUCCEEDED)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class DisableCanaryTask extends AbstractCloudProviderAwareTask implements Task {
String cloudProvider = ops && !ops.empty ? ops.first()?.values().first()?.cloudProvider : getCloudProvider(stage) ?: 'aws'
def taskId = katoService.requestOperations(cloudProvider, ops).toBlocking().first()

stage.context.remove('waitTaskState')
return new TaskResult(ExecutionStatus.SUCCEEDED, [
'kato.last.task.id' : taskId,
'deploy.server.groups' : dSG,
Expand Down

0 comments on commit 8643fa2

Please sign in to comment.