Spaces:
Sleeping
Sleeping
Bound generated bug validation execution
Browse filesFiles changed (2)
5 unmodified lines67891011812 unmodified lines82482582682782882912 unmodified lines8428438448458468475 unmodified linesimport osimport randomimport reimport sysimport textwrapimport tokenize812 unmodified lines"__package__": package_name,"__file__": str(source_path),}try:with without_llm_credentials():exec(compile(full_source, file_path or "<exec>", "exec"), namespace) # runs all imports + defs12 unmodified lineserror_message = "<exception message unavailable>"return False, f"ERROR:{type(e).__name__}: {error_message}"finally:for module_name in reversed(package_modules):sys.modules.pop(module_name, None)for added_path in added_paths:5 unmodified lines6789101112812 unmodified lines82582682782882983083183283383483583612 unmodified lines8498508518528538548558568578585 unmodified linesimport osimport randomimport reimport signalimport sysimport textwrapimport tokenize812 unmodified lines"__package__": package_name,"__file__": str(source_path),}old_alarm_handler = Noneif hasattr(signal, "SIGALRM"):def _test_timeout_handler(_signum, _frame):raise TimeoutError("Challenge test execution exceeded 3 seconds")old_alarm_handler = signal.signal(signal.SIGALRM, _test_timeout_handler)signal.alarm(3)try:with without_llm_credentials():exec(compile(full_source, file_path or "<exec>", "exec"), namespace) # runs all imports + defs12 unmodified lineserror_message = "<exception message unavailable>"return False, f"ERROR:{type(e).__name__}: {error_message}"finally:if hasattr(signal, "SIGALRM"):signal.alarm(0)if old_alarm_handler is not None:signal.signal(signal.SIGALRM, old_alarm_handler)for module_name in reversed(package_modules):sys.modules.pop(module_name, None)for added_path in added_paths:
117 unmodified lines118119120121122123117 unmodified linesassert result == "ERROR:BrokenMessageError: <exception message unavailable>"def test_function_execution_normalizes_process_specific_object_addresses():source = "def target():\n return object()\n"117 unmodified lines118119120121122123124125126127128129130131132117 unmodified linesassert result == "ERROR:BrokenMessageError: <exception message unavailable>"def test_function_execution_times_out_for_infinite_loop():if not hasattr(__import__('signal'), 'SIGALRM'):returnsource = "def target():\n while True:\n pass\n"succeeded, result = _try_exec(source, "target", "()")assert not succeededassert result.startswith("ERROR:TimeoutError:")def test_function_execution_normalizes_process_specific_object_addresses():source = "def target():\n return object()\n"
architect/saboteur.py+11
test_saboteur_generated_test_validation.py+9