Skip to content

Commit

Permalink
fix 400 Bad Request: Cannot update runtime status of entry from waiti…
Browse files Browse the repository at this point in the history
…ng to running
  • Loading branch information
Yifan Zhang authored and Yifan Zhang committed Aug 30, 2023
1 parent 68ed7d1 commit a6823ae
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions testplan/runnable/interactive/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,23 @@ def _should_run(uid, curr_status, new_status):
"""
if new_status == curr_status:
return False

# test entry already triggered
elif (
new_status == RuntimeStatus.RUNNING
and curr_status == RuntimeStatus.WAITING
):
return False

elif new_status == RuntimeStatus.RUNNING:
if curr_status not in (RuntimeStatus.RESETTING, RuntimeStatus.WAITING):
return True
else:

if curr_status == RuntimeStatus.RESETTING:
raise werkzeug.exceptions.BadRequest(
"Cannot update runtime status of entry"
f' "{uid}" from "{curr_status}" to "{new_status}"'
)
return True

return False


Expand Down

0 comments on commit a6823ae

Please sign in to comment.