Skip to content

Commit

Permalink
for resources test, raise the claimed amount to give us more wiggle room
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Jul 20, 2023
1 parent 4f90ea2 commit 7e8df7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/core/resources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ def test_051_Resources_check_claims(self):

@unittest_reporter(name='Resources.check_claims() - memory overuse')
def test_052_Resources_check_claims(self):
raw = {'cpu':8, 'gpu':['0','1'], 'memory':.4, 'disk':20,
raw = {'cpu':8, 'gpu':['0','1'], 'memory':.8, 'disk':20,
'time':12}
r = iceprod.core.resources.Resources(raw=raw)
task_id = 'foo'
reqs = {'cpu':1, 'gpu':1, 'memory':.25, 'disk':3.4, 'time': 1}
reqs = {'cpu':1, 'gpu':1, 'memory':.5, 'disk':3.4, 'time': 1}
c = r.claim(task_id, reqs)
proc = psutil.Process()
tmpdir = self.test_dir
Expand All @@ -305,7 +305,7 @@ def test_052_Resources_check_claims(self):

usage = r.get_usage(task_id)
megabyte = 2**18
extra_mem = max(0, 256 - int(usage['memory']/1000))
extra_mem = max(0, 500 - int(usage['memory']/1000))

# test managable overusage
import array
Expand All @@ -316,7 +316,7 @@ def test_052_Resources_check_claims(self):
self.assertEqual(ret, {})

# test overusage above total
blah *= 2 # 512 MB
blah *= 2 # 1000 MB
ret = r.check_claims(force=True)
logger.info('check_claims ret: %r',ret)
self.assertIn(task_id, ret)
Expand Down

0 comments on commit 7e8df7a

Please sign in to comment.