Fix heartbeatTimeout of NONE and polling responses when there are no tasks (#3680)
* fix heartbeatTimeout of NONE resulting in ValueError and polling returning empty string taskToken when it shouldn't be returned * fix expected taskToken in impacted tests Co-authored-by: Clint Parham <cparham@aligntech.com>
This commit is contained in:
parent
f246d4162f
commit
b60de10c79
5 changed files with 28 additions and 13 deletions
|
|
@ -73,7 +73,10 @@ class ActivityTask(BaseModel):
|
|||
def first_timeout(self):
|
||||
if not self.open or not self.workflow_execution.open:
|
||||
return None
|
||||
# TODO: handle the "NONE" case
|
||||
|
||||
if self.timeouts["heartbeatTimeout"] == "NONE":
|
||||
return None
|
||||
|
||||
heartbeat_timeout_at = self.last_heartbeat_timestamp + int(
|
||||
self.timeouts["heartbeatTimeout"]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -446,9 +446,7 @@ class SWFResponse(BaseResponse):
|
|||
if decision:
|
||||
return json.dumps(decision.to_full_dict(reverse_order=reverse_order))
|
||||
else:
|
||||
return json.dumps(
|
||||
{"previousStartedEventId": 0, "startedEventId": 0, "taskToken": ""}
|
||||
)
|
||||
return json.dumps({"previousStartedEventId": 0, "startedEventId": 0})
|
||||
|
||||
def count_pending_decision_tasks(self):
|
||||
domain_name = self._params["domain"]
|
||||
|
|
@ -482,7 +480,7 @@ class SWFResponse(BaseResponse):
|
|||
if activity_task:
|
||||
return json.dumps(activity_task.to_full_dict())
|
||||
else:
|
||||
return json.dumps({"startedEventId": 0, "taskToken": ""})
|
||||
return json.dumps({"startedEventId": 0})
|
||||
|
||||
def count_pending_activity_tasks(self):
|
||||
domain_name = self._params["domain"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue