Lines Matching +full:timeout +full:- +full:minutes
20 runtest, is_failed, TestResult, Interrupted, Timeout, ChildError, PROGRESS_MIN_TIME)
32 # Kill the main process after 5 minutes. It is supposed to write an update
33 # every PROGRESS_UPDATE seconds. Tolerate 5 minutes for Python slowest
44 def must_stop(result: TestResult, ns: Namespace) -> bool:
52 def parse_worker_args(worker_args) -> tuple[Namespace, str]:
58 def run_test_in_subprocess(testname: str, ns: Namespace, stdout_fh: TextIO) -> subprocess.Popen:
67 '-u', # Unbuffered stdout and stderr
68 '-m', 'test.regrtest',
69 '--worker-args', worker_args]
76 # bpo-45410: Write stderr into stdout to keep messages order
87 def run_tests_worker(ns: Namespace, test_name: str) -> NoReturn:
102 """A thread-safe iterator over tests for multiprocess mode."""
124 # bpo-45410: stderr is written into stdout to keep messages order
138 def __init__(self, worker_id: int, runner: "MultiprocessTestRunner") -> None:
144 self.timeout = runner.worker_timeout
152 def __repr__(self) -> str:
163 dt = time.monotonic() - self.start_time
168 def _kill(self) -> None:
196 def stop(self) -> None:
206 ) -> MultiprocessResult:
207 test_result.duration_sec = time.monotonic() - self.start_time
210 def _run_process(self, test_name: str, stdout_fh: TextIO) -> int:
232 # gh-94026: stdout+stderr are written to tempfile
233 retcode = popen.wait(timeout=self.timeout)
242 # On timeout, kill the process
245 # None means TIMEOUT for the caller
247 # bpo-38207: Don't attempt to call communicate() again: on it
264 def _runtest(self, test_name: str) -> MultiprocessResult:
266 # gh-95027: When stdout is not a TTY, Python uses the ANSI code
268 # terminal, sys.stdout uses WindowsConsoleIO with UTF-8 encoding.
272 # gh-94026: Write stdout+stderr to a tempfile as workaround for
273 # non-blocking pipes on Emscripten with NodeJS.
275 # gh-93353: Check for leaked temporary files in the parent process,
283 return self.mp_result_error(Timeout(test_name), stdout)
305 def run(self) -> None:
324 def _wait_completed(self) -> None:
331 f"(timeout={format_duration(JOIN_TIMEOUT)}): "
334 def wait_stopped(self, start_time: float) -> None:
335 # bpo-38207: MultiprocessTestRunner.stop_workers() called self.stop()
338 # TestWorkerProcess thread. This loop with a timeout is a workaround
350 dt = time.monotonic() - start_time
358 def get_running(workers: list[TestWorkerProcess]) -> list[TestWorkerProcess]:
364 dt = time.monotonic() - worker.start_time
372 def __init__(self, regrtest: Regrtest) -> None:
378 if self.ns.timeout is not None:
381 # of 5 minutes to faulthandler to kill the worker.
382 self.worker_timeout = min(self.ns.timeout * 1.5,
383 self.ns.timeout + 5 * 60)
388 def start_workers(self) -> None:
392 if self.ns.timeout:
393 msg += (" (timeout: %s, worker timeout: %s)"
394 % (format_duration(self.ns.timeout),
400 def stop_workers(self) -> None:
407 def _get_result(self) -> QueueOutput | None:
408 use_faulthandler = (self.ns.timeout is not None)
409 timeout = PROGRESS_UPDATE
411 # bpo-46205: check the status of workers every iteration to avoid
420 return self.output.get(timeout=timeout)
431 return self.output.get(timeout=0)
435 def display_result(self, mp_result: MultiprocessResult) -> None:
446 text += ' -- running: %s' % ', '.join(running)
449 def _process_result(self, item: QueueOutput) -> bool:
470 def run_tests(self) -> None:
487 if self.ns.timeout is not None:
496 def run_tests_multiprocess(regrtest: Regrtest) -> None:
503 def default(self, o: Any) -> dict[str, Any]:
512 def decode_test_result(d: dict[str, Any]) -> TestResult | dict[str, Any]:
524 def get_all_test_result_classes() -> set[type[TestResult]]: