How does ComfyUI's tests/execution harness start a server and test graphs, and can I reuse the pattern for a custom node pack?
Problem: automated tests for node behaviour (caching, validation errors, missing nodes) rather than image quality. Conditions: ComfyUI commit fb3befd, tests/execution/test_execution.py (over 1,300 lines). Method: a class-scoped pytest fixture starts python main.py as a subprocess with --output-directory, --listen, --port, --extra-model-paths-config tests/execution/extra_model_paths.yaml and --cpu, parametrised over four modes (--cache-classic, --cache-lru 100, --cache-none, and default with assets enabled). A websocket client then submits graphs built with GraphBuilder from comfy_execution.graph_utils, including nodes from tests/execution/testing_nodes/testing-pack, and asserts on outputs and errors (e.g. test_missing_node_error submits a graph with a removed node and checks the server survives). conftest.py adds --skip-timing-checks for variable CI machines. Inference: a custom-node author can copy the fixture, point custom nodes at a test pack and parametrise cache modes; nothing ...
Structured fields
{
"citations": [
{
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/fb3befd168731438f88bc96e0920a538e8649878/tests/execution/test_execution.py",
"note": "server fixture params; server fixture; test_missing_node_error; pytest_addoption"
},
{
"url": "https://raw.githubusercontent.com/Comfy-Org/ComfyUI/fb3befd168731438f88bc96e0920a538e8649878/tests/conftest.py",
"note": "server fixture params; server fixture; test_missing_node_error; pytest_addoption"
}
]
}Evidence claims
- [sourced_fact] Problem: automated tests for node behaviour (caching, validation errors, missing nodes) rather than image quality. Conditions: ComfyUI commit fb3befd, tests/execution/test_execution.py (over 1,300 lines). Method: a class-scoped pytest fixture starts python main.py as a subprocess with --output-directory, --listen, --port, --extra-model-paths-config tests/execution/extra_model_paths.yaml and --cpu, parametrised over four modes (--cache-classic, --cache-lru 100, --cache-none, and default with assets enabled). A websocket client then submits graphs built with GraphBuilder from comfy_execution.graph_utils, including nodes from tests/execution/testing_nodes/testing-pack, and asserts on outputs and errors (e.g. test_missing_node_error submits a graph with a removed node and checks the server survives). conftest.py adds --skip-timing-checks for variable CI machines. Inference: a custom-node author can copy the fixture, point custom nodes at a test pack and parametrise cache modes; nothing here is documented as an official custom-node test kit. Failure modes: fixed 4 s sleeps and 5 connection retries can flake on slow runners; torch import required. Limitations: not executed. Version/date: fb3befd, 2026-10-23. · locator: server fixture params; server fixture; test_missing_node_error; pytest_addoption source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |