• Home
  • Raw
  • Download

Lines Matching +full:timeout +full:- +full:minutes

20     runtest, is_failed, TestResult, Interrupted, Timeout, ChildError, PROGRESS_MIN_TIME)
29 # Kill the main process after 5 minutes. It is supposed to write an update
30 # every PROGRESS_UPDATE seconds. Tolerate 5 minutes for Python slowest
41 def must_stop(result: TestResult, ns: Namespace) -> bool:
49 def parse_worker_args(worker_args) -> tuple[Namespace, str]:
55 def run_test_in_subprocess(testname: str, ns: Namespace) -> subprocess.Popen:
61 '-u', # Unbuffered stdout and stderr
62 '-m', 'test.regrtest',
63 '--worker-args', worker_args]
80 def run_tests_worker(ns: Namespace, test_name: str) -> NoReturn:
95 """A thread-safe iterator over tests for multiprocess mode."""
131 def __init__(self, worker_id: int, runner: "MultiprocessTestRunner") -> None:
137 self.timeout = runner.worker_timeout
145 def __repr__(self) -> str:
156 dt = time.monotonic() - self.start_time
161 def _kill(self) -> None:
189 def stop(self) -> None:
200 ) -> MultiprocessResult:
201 test_result.duration_sec = time.monotonic() - self.start_time
204 def _run_process(self, test_name: str) -> tuple[int, str, str]:
226 stdout, stderr = popen.communicate(timeout=self.timeout)
235 # On timeout, kill the process
238 # None means TIMEOUT for the caller
240 # bpo-38207: Don't attempt to call communicate() again: on it
263 def _runtest(self, test_name: str) -> MultiprocessResult:
267 return self.mp_result_error(Timeout(test_name), stdout, stderr)
290 def run(self) -> None:
309 def _wait_completed(self) -> None:
321 f"(timeout={format_duration(JOIN_TIMEOUT)}): "
324 def wait_stopped(self, start_time: float) -> None:
325 # bpo-38207: MultiprocessTestRunner.stop_workers() called self.stop()
328 # TestWorkerProcess thread. This loop with a timeout is a workaround
340 dt = time.monotonic() - start_time
348 def get_running(workers: list[TestWorkerProcess]) -> list[TestWorkerProcess]:
354 dt = time.monotonic() - worker.start_time
362 def __init__(self, regrtest: Regrtest) -> None:
368 if self.ns.timeout is not None:
371 # of 5 minutes to faulthandler to kill the worker.
372 self.worker_timeout = min(self.ns.timeout * 1.5,
373 self.ns.timeout + 5 * 60)
378 def start_workers(self) -> None:
382 if self.ns.timeout:
383 msg += (" (timeout: %s, worker timeout: %s)"
384 % (format_duration(self.ns.timeout),
390 def stop_workers(self) -> None:
397 def _get_result(self) -> QueueOutput | None:
398 use_faulthandler = (self.ns.timeout is not None)
399 timeout = PROGRESS_UPDATE
401 # bpo-46205: check the status of workers every iteration to avoid
410 return self.output.get(timeout=timeout)
421 return self.output.get(timeout=0)
425 def display_result(self, mp_result: MultiprocessResult) -> None:
436 text += ' -- running: %s' % ', '.join(running)
439 def _process_result(self, item: QueueOutput) -> bool:
462 def run_tests(self) -> None:
479 if self.ns.timeout is not None:
488 def run_tests_multiprocess(regrtest: Regrtest) -> None:
495 def default(self, o: Any) -> dict[str, Any]:
504 def decode_test_result(d: dict[str, Any]) -> TestResult | dict[str, Any]:
516 def get_all_test_result_classes() -> set[type[TestResult]]: