Skip to content

Commit

Permalink
Run: Fall back to setting queued status
Browse files Browse the repository at this point in the history
When a run consists of jobs with a mix of 'queued' and 'pass' statuses, they
are ending up with a status of 'unknown'. Use 'queued' in that case instead.

Signed-off-by: Zack Cerza <[email protected]>
  • Loading branch information
zmc committed Aug 9, 2024
1 parent 2de3e87 commit 298a18f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paddles/models/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ def set_status(self, results=None):
# all passing => pass
elif results['pass'] == total:
new_status = 'finished pass'
elif results['queued']:
new_status = 'queued'
# this should not happen
else:
new_status = 'unknown'
Expand Down
7 changes: 7 additions & 0 deletions paddles/tests/models/test_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ def test_run_status_all_dead(self):
#Job(dict(job_id=16, id=16, status='dead'), new_run)
assert new_run.status == 'finished dead'

def test_run_status_one_pass(self):
run_name = "run_status_one_pass"
new_run = Run(run_name)
Job(dict(job_id=15, id=15, status='queued'), new_run)
Job(dict(job_id=50, id=50, status='pass'), new_run)
assert new_run.status == 'queued'

def test_run_user(self):
run_name = "teuthology-2013-12-22_01:00:02-x-x-x-x-x"
new_run = Run(run_name)
Expand Down

0 comments on commit 298a18f

Please sign in to comment.