From bb8d4180540602088e24f5cd6ce90eeb52f6e4fb Mon Sep 17 00:00:00 2001 From: Constantino Schillebeeckx Date: Fri, 27 Mar 2020 15:35:50 -0500 Subject: [PATCH] fix: stepfunction stop_execution Fixes #2846 Calling stop_execution on a stepfunction should set the status to `ABORTED` not `SUCCEEDED`. --- moto/stepfunctions/models.py | 2 +- tests/test_stepfunctions/test_stepfunctions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/stepfunctions/models.py b/moto/stepfunctions/models.py index de530b863..e36598f23 100644 --- a/moto/stepfunctions/models.py +++ b/moto/stepfunctions/models.py @@ -46,7 +46,7 @@ class Execution: self.stop_date = None def stop(self): - self.status = "SUCCEEDED" + self.status = "ABORTED" self.stop_date = iso_8601_datetime_without_milliseconds(datetime.now()) diff --git a/tests/test_stepfunctions/test_stepfunctions.py b/tests/test_stepfunctions/test_stepfunctions.py index 3e0a8115d..eb2ace53d 100644 --- a/tests/test_stepfunctions/test_stepfunctions.py +++ b/tests/test_stepfunctions/test_stepfunctions.py @@ -516,7 +516,7 @@ def test_state_machine_describe_execution_after_stoppage(): description = client.describe_execution(executionArn=execution["executionArn"]) # description["ResponseMetadata"]["HTTPStatusCode"].should.equal(200) - description["status"].should.equal("SUCCEEDED") + description["status"].should.equal("ABORTED") description["stopDate"].should.be.a(datetime)