Merge pull request #2769 from EpicWink/swf-empty-task

Return empty task-token on no-task
This commit is contained in:
Bert Blommers 2020-02-25 17:05:16 +00:00 committed by GitHub
commit f8af496445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 6 deletions

View file

@ -35,14 +35,14 @@ def test_poll_for_activity_task_when_one():
def test_poll_for_activity_task_when_none():
conn = setup_workflow()
resp = conn.poll_for_activity_task("test-domain", "activity-task-list")
resp.should.equal({"startedEventId": 0})
resp.should.equal({"startedEventId": 0, "taskToken": ""})
@mock_swf_deprecated
def test_poll_for_activity_task_on_non_existent_queue():
conn = setup_workflow()
resp = conn.poll_for_activity_task("test-domain", "non-existent-queue")
resp.should.equal({"startedEventId": 0})
resp.should.equal({"startedEventId": 0, "taskToken": ""})
# CountPendingActivityTasks endpoint

View file

@ -62,14 +62,18 @@ def test_poll_for_decision_task_when_none():
resp = conn.poll_for_decision_task("test-domain", "queue")
# this is the DecisionTask representation you get from the real SWF
# after waiting 60s when there's no decision to be taken
resp.should.equal({"previousStartedEventId": 0, "startedEventId": 0})
resp.should.equal(
{"previousStartedEventId": 0, "startedEventId": 0, "taskToken": ""}
)
@mock_swf_deprecated
def test_poll_for_decision_task_on_non_existent_queue():
conn = setup_workflow()
resp = conn.poll_for_decision_task("test-domain", "non-existent-queue")
resp.should.equal({"previousStartedEventId": 0, "startedEventId": 0})
resp.should.equal(
{"previousStartedEventId": 0, "startedEventId": 0, "taskToken": ""}
)
@mock_swf_deprecated