Skip to content

Commit 229bd32

Browse files
committed
fix: add min time limit
1 parent 81ec010 commit 229bd32

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bigcodebench/gen/util/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ def trusted_exec(code, test_code, task_id, max_as_limit, max_data_limit, max_sta
5454
start = time.time()
5555
with safe_environment(), swallow_io(), time_limit(seconds=TIMEOUT_LIMIT):
5656
suite.run(test_result)
57-
58-
if len(test_result.failures + test_result.errors) > 0:
57+
58+
errors = test_result.failures + test_result.errors
59+
if len(errors) > 0:
60+
print(errors)
5961
times.value = -1
6062
else:
6163
times.value = time.time() - start
@@ -83,8 +85,9 @@ def trusted_check(
8385
max_as_limit: float,
8486
max_data_limit: float,
8587
max_stack_limit: float,
88+
min_time_limit: float = 10,
8689
):
87-
timeout = os.getenv("BIGCODEBENCH_TIMEOUT_PER_TASK", TIMEOUT_LIMIT) + 1
90+
timeout = max(os.getenv("BIGCODEBENCH_TIMEOUT_PER_TASK", TIMEOUT_LIMIT), time_limit) + 1
8891
# shared memory objects
8992
times = Value("d", -1)
9093
manager = Manager()

0 commit comments

Comments
 (0)