Skip to content

Commit

Permalink
expire any summarized jobs that are not expired for some reason. (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
willgraf committed Apr 24, 2020
1 parent b628f95 commit 17a5772
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions benchmarking/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def get_completed_job_count(self):
if j.status == 'done' and not j.is_summarized:
j.summarize()

# TODO: patched! sometimes jobs don't get expired?
elif j.status == 'done' and j.is_summarized and not j.is_expired:
j.expire()

self.logger.info('%s created; %s finished; %s summarized; '
'%s; %s jobs total', created, expired, complete,
'; '.join('%s %s' % (v, k)
Expand Down
14 changes: 14 additions & 0 deletions benchmarking/manager_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def test_get_completed_job_count(self):
j2.status = 'failed'
assert mgr.get_completed_job_count() == 0

j1.status = 'done'
j2.status = 'done'
assert mgr.get_completed_job_count() == 0

def fake_restart(delay):
return None

Expand All @@ -112,6 +116,16 @@ def fake_restart(delay):
j1.is_expired = True
assert mgr.get_completed_job_count() == 1

# test patch, summarized but not expired
j1.failed = False
j1.status = 'done'
j1.created_at = 1
j1.finished_at = 1
j1.output_url = 1
j1.is_expired = False
j1.expire = lambda: None
assert mgr.get_completed_job_count() == 0

def test_summarize(self):

# pylint: disable=unused-argument
Expand Down

0 comments on commit 17a5772

Please sign in to comment.