Run cm-cli update-cache (blocking) to populate Manager cache before tests. Timeout is generous (600s): update-cache downloads the full DB lists over the network and routinely exceeds 120s on slow links, which used to fail the whole module at setup.
()
| 64 | |
| 65 | |
| 66 | def _ensure_cache(): |
| 67 | """Run cm-cli update-cache (blocking) to populate Manager cache before tests. |
| 68 | |
| 69 | Timeout is generous (600s): update-cache downloads the full DB lists |
| 70 | over the network and routinely exceeds 120s on slow links, which used |
| 71 | to fail the whole module at setup. |
| 72 | """ |
| 73 | env = {**os.environ, "COMFYUI_PATH": COMFYUI_PATH} |
| 74 | r = subprocess.run( |
| 75 | [_cm_cli_path(), "update-cache"], |
| 76 | capture_output=True, text=True, timeout=600, env=env, |
| 77 | ) |
| 78 | if r.returncode != 0: |
| 79 | raise RuntimeError(f"update-cache failed:\n{r.stderr}") |
| 80 | |
| 81 | |
| 82 | def _start_comfyui() -> int: |
no test coverage detected