Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(canary): fix wait task after baseline asg disable #1771

Merged
merged 2 commits into from
Nov 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,9 +48,10 @@ 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)
// leaving skipRemainingWait unchanged since added to context elsewhere
new TaskResult(SUCCEEDED, [waitTaskState: [:]])
} else {
new TaskResult(RUNNING)
}
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