Keep track of previous started event ID
Closes #2107 Signed-off-by: Laurie O <laurie_opperman@hotmail.com>
This commit is contained in:
parent
369285b7ca
commit
209c999706
4 changed files with 31 additions and 3 deletions
|
|
@ -30,9 +30,10 @@ def test_decision_task_full_dict_representation():
|
|||
fd["workflowExecution"].should.equal(wfe.to_short_dict())
|
||||
fd["workflowType"].should.equal(wft.to_short_dict())
|
||||
|
||||
dt.start(1234)
|
||||
dt.start(1234, 1230)
|
||||
fd = dt.to_full_dict()
|
||||
fd["startedEventId"].should.equal(1234)
|
||||
fd["previousStartedEventId"].should.equal(1230)
|
||||
|
||||
|
||||
def test_decision_task_first_timeout():
|
||||
|
|
|
|||
|
|
@ -30,6 +30,30 @@ def test_poll_for_decision_task_when_one():
|
|||
)
|
||||
|
||||
|
||||
@mock_swf_deprecated
|
||||
def test_poll_for_decision_task_previous_started_event_id():
|
||||
conn = setup_workflow()
|
||||
|
||||
resp = conn.poll_for_decision_task("test-domain", "queue")
|
||||
assert resp["workflowExecution"]["runId"] == conn.run_id
|
||||
assert "previousStartedEventId" not in resp
|
||||
|
||||
# Require a failing decision, in this case a non-existant activity type
|
||||
attrs = {
|
||||
"activityId": "spam",
|
||||
"activityType": {"name": "test-activity", "version": "v1.42"},
|
||||
"taskList": "eggs",
|
||||
}
|
||||
decision = {
|
||||
"decisionType": "ScheduleActivityTask",
|
||||
"scheduleActivityTaskDecisionAttributes": attrs,
|
||||
}
|
||||
conn.respond_decision_task_completed(resp["taskToken"], decisions=[decision])
|
||||
resp = conn.poll_for_decision_task("test-domain", "queue")
|
||||
assert resp["workflowExecution"]["runId"] == conn.run_id
|
||||
assert resp["previousStartedEventId"] == 3
|
||||
|
||||
|
||||
@mock_swf_deprecated
|
||||
def test_poll_for_decision_task_when_none():
|
||||
conn = setup_workflow()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue