| 459 | results = [None] * count |
| 460 | |
| 461 | def _one(index): |
| 462 | try: |
| 463 | results[index] = run_cli(binary, cache, ["cli", "list_projects", "{}"], |
| 464 | timeout=120) |
| 465 | except subprocess.TimeoutExpired as exc: |
| 466 | # Keep the hang as a failed result WITH its partial output; raised |
| 467 | # on the worker thread it was lost, and the client reported as |
| 468 | # "rc=none" with nothing to read. |
| 469 | results[index] = subprocess.CompletedProcess( |
| 470 | exc.cmd, TIMEOUT_RC, exc.stdout or b"", |
| 471 | (exc.stderr or b"") + ("\n[timed out after %ss]" % exc.timeout).encode()) |
| 472 | |
| 473 | threads = [threading.Thread(target=_one, args=(i,)) for i in range(count)] |
| 474 | for thread in threads: |