Skip to content

Commit

Permalink
Replace time-wall with wall-time; fix #32
Browse files Browse the repository at this point in the history
  • Loading branch information
zopieux committed Oct 25, 2017
1 parent 2742fef commit 0442528
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
3 changes: 3 additions & 0 deletions camisole/isolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ async def __aexit__(self, exc, value, tb):
'XX': 'INTERNAL_ERROR',
}
self.meta['status'] = verbose_status[self.meta['status']]
# replace time-wall with wall-time for consistency with the limit name
# https://github.com/ioi/isolate/issues/20
self.meta['wall-time'] = self.meta.pop('time-wall')

self.info = {
'stdout': self.stdout,
Expand Down
2 changes: 1 addition & 1 deletion camisole/progs/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def benchmark(lang_name, verbose):
return (str(memory),
format_stats([m['max-rss'] for m in metas], 5),
format_stats([m['time'] for m in metas], 1, 3),
format_stats([m['time-wall'] for m in metas], 1, 3))
format_stats([m['wall-time'] for m in metas], 1, 3))


def handle(args):
Expand Down
2 changes: 1 addition & 1 deletion doc/res/001-python-42.out.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"message": null,
"status": "OK",
"time": 0.017,
"time-wall": 0.072
"wall-time": 0.069
},
"name": "test000",
"stderr": "",
Expand Down
8 changes: 4 additions & 4 deletions doc/res/002-ocaml-simple.out.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"max-rss": 15276,
"message": null,
"status": "OK",
"time": 0.085,
"time-wall": 0.13
"time": 0.122,
"wall-time": 0.344
},
"stderr": "",
"stdout": ""
Expand All @@ -33,8 +33,8 @@
"max-rss": 1820,
"message": null,
"status": "OK",
"time": 0.001,
"time-wall": 0.033
"time": 0.002,
"wall-time": 0.058
},
"name": "test000",
"stderr": "",
Expand Down
14 changes: 7 additions & 7 deletions doc/res/003-python-testsuite.out.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"message": null,
"status": "OK",
"time": 0.016,
"time-wall": 0.06
"wall-time": 0.05
},
"name": "test_h2g2",
"stderr": "",
Expand All @@ -34,8 +34,8 @@
"max-rss": 7448,
"message": null,
"status": "OK",
"time": 0.018,
"time-wall": 0.063
"time": 0.026,
"wall-time": 0.072
},
"name": "test_notfound",
"stderr": "",
Expand All @@ -54,8 +54,8 @@
"max-rss": 7428,
"message": null,
"status": "OK",
"time": 0.015,
"time-wall": 0.064
"time": 0.026,
"wall-time": 0.083
},
"name": "test_leet",
"stderr": "",
Expand All @@ -74,8 +74,8 @@
"max-rss": 7736,
"message": null,
"status": "OK",
"time": 0.025,
"time-wall": 0.082
"time": 0.029,
"wall-time": 0.092
},
"name": "test_666",
"stderr": "",
Expand Down
10 changes: 5 additions & 5 deletions tests/test_walltime.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def test_no_limit():
r = await python_sleep(duration).run()
test = r['tests'][0]['meta']
assert test['status'] == 'OK'
assert abs(test['time-wall'] - duration) < tolerance
assert abs(test['wall-time'] - duration) < tolerance


@pytest.mark.asyncio
Expand All @@ -33,7 +33,7 @@ async def test_below_limit():
r = await python_sleep(duration, limit).run()
test = r['tests'][0]['meta']
assert test['status'] == 'OK'
assert abs(test['time-wall'] - limit) < tolerance
assert abs(test['wall-time'] - limit) < tolerance


@pytest.mark.asyncio
Expand All @@ -43,7 +43,7 @@ async def test_above_limit():
r = await python_sleep(duration, limit).run()
test = r['tests'][0]['meta']
assert test['status'] == 'TIMED_OUT'
assert abs(test['time-wall'] - limit) < tolerance
assert abs(test['wall-time'] - limit) < tolerance
assert "time limit exceeded" in test['message'].lower()


Expand All @@ -55,7 +55,7 @@ async def test_local_limit_stricter():
r = await python_sleep(duration, glimit, llimit).run()
test = r['tests'][0]['meta']
assert test['status'] == 'TIMED_OUT'
assert abs(test['time-wall'] - llimit) < tolerance
assert abs(test['wall-time'] - llimit) < tolerance
assert "time limit exceeded" in test['message'].lower()


Expand All @@ -67,4 +67,4 @@ async def test_local_limit_larger():
r = await python_sleep(duration, glimit, llimit).run()
test = r['tests'][0]['meta']
assert test['status'] == 'OK'
assert abs(test['time-wall'] - llimit) < tolerance
assert abs(test['wall-time'] - llimit) < tolerance

0 comments on commit 0442528

Please sign in to comment.