Skip to content

Commit

Permalink
don't rely on defaults in cost test (#7816)
Browse files Browse the repository at this point in the history
  • Loading branch information
cseed authored and danking committed Jan 7, 2020
1 parent a400a1c commit 343ac97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions batch/test/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def test_job(self):

def test_msec_mcpu(self):
builder = self.client.create_batch()
resources = {'cpu': '100m'}
# two jobs so the batch msec_mcpu computation is non-trivial
builder.create_job('ubuntu:18.04', ['echo', 'foo'])
builder.create_job('ubuntu:18.04', ['echo', 'bar'])
builder.create_job('ubuntu:18.04', ['echo', 'foo'], resources=resources)
builder.create_job('ubuntu:18.04', ['echo', 'bar'], resources=resources)
b = builder.submit()

batch = b.wait()
Expand All @@ -65,7 +66,7 @@ def test_msec_mcpu(self):
for job in b.jobs():
job_status = job['status']

# tests run at 100mcpu
# runs at 100mcpu
job_msec_mcpu2 = 100 * max(job_status['end_time'] - job_status['start_time'], 0)
# greater than in case there are multiple attempts
assert job['msec_mcpu'] >= job_msec_mcpu2, batch
Expand Down

0 comments on commit 343ac97

Please sign in to comment.