Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

docs(tests): describe the slow marker as the lane it is

Alexander Eichhornaefb8a2957dd
diff --git a/AGENTS.md b/AGENTS.md
index a4f58493e8..0b4333d898 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -65,7 +65,7 @@ If the environment cannot spawn subagents, perform separate self-review passes w
- Use **pnpm 10**, never npm/yarn, for frontends and docs. Each package owns its lockfile. Use `pnpm -C <package> ...`; `.nvmrc` records the development Node version. Read the package scripts instead of assuming root Makefile frontend commands target webv2.
- Use the existing Python environment and `uv.lock`. For a fresh test environment: `uv sync --locked --extra test`; do not replace a configured accelerator environment with a different backend as routine setup.
- From the root: `uv tool run [email protected] check <paths>` and `uv tool run [email protected] format --check <paths>`. Python uses 120-column formatting and absolute imports. Respect configured vendored-code exclusions.
-- Run focused Python tests with `uv run --no-sync pytest <test-paths>`; the full CI suite is `uv run --no-sync pytest -n logical` (xdist; each file's tests stay on a single worker). Slow tests are excluded by default and no job runs them, so marking a test `slow` removes it from automated protection; hardware validation is separate.
+- Run focused Python tests with `uv run --no-sync pytest <test-paths>`; the full CI suite is `uv run --no-sync pytest -n logical` (xdist; each file's tests stay on a single worker). Slow tests are excluded by default: `slow` is the lane for what needs a development machine -- real accelerator hardware, or a quiet one for timing -- and is run there with `-m slow`, not by CI.
- `uv run --no-sync mypy scripts/invokeai-web.py` is an additional diagnostic using the current exclusions, not an enforced CI gate. Do not describe it as comprehensive type coverage.
- Choose checks by changed behavior. Broaden to the milestone's required gates before review; do not repeatedly rerun unchanged checks without a reason.
- Install local hooks with `uv run --no-sync pre-commit install` after test dependencies are available. Hook installation is local to each checkout and is not implied by committing the configuration.
diff --git a/tests/AGENTS.md b/tests/AGENTS.md
index 3b2a90f5ca..2abd5c279c 100644
--- a/tests/AGENTS.md
+++ b/tests/AGENTS.md
@@ -7,7 +7,7 @@
- Prefer real temporary SQLite/filesystem/tensor operations when they establish the behavior. Mock external services, expensive models, or unavailable hardware at an appropriate interface; never mock away the transaction, authorization, concurrency, or numerical behavior being checked.
- Isolate filesystem paths, databases, account identities, clocks, random seeds, environment changes, and network behavior. Clean up subprocesses, listeners, patches, and resources. Never use production model/database/output directories.
- Exercise rollback, revisions, cross-user isolation, retries, cancellation, resource bounds, and cleanup when affected. Frontend IndexedDB, Web Locks, focus, and rendering belong in webv2's real-browser tests.
-- Run `uv run --no-sync pytest <test-paths>` from the root for focused checks; CI uses `uv run --no-sync pytest -n logical`, which runs the suite across xdist workers (one per vCPU). Configuration excludes `slow` by default and no job runs `-m slow`, so the marker removes a test from automated protection rather than moving it to a slower tier. Use `-m slow` for selected slow tests or `-m ""` to include them deliberately.
+- Run `uv run --no-sync pytest <test-paths>` from the root for focused checks; CI uses `uv run --no-sync pytest -n logical`, which runs the suite across xdist workers (one per vCPU). Configuration excludes `slow` by default: the marker is the lane for tests that need a development machine -- real accelerator hardware, or a quiet one for timing -- and CI does not run them. Run them there with `-m slow` for a selection, or `-m ""` to include everything.
- Tests must pass under parallel execution, in any file order. `--dist loadfile` (set in `addopts`) keeps a file's tests on one worker, but which files a worker gets is arbitrary: a file must establish its own process-global state (the JWT secret, for example) instead of inheriting it from a file that happens to run earlier. Verify a new file passes when run on its own.
-- Assert behavior, not throughput or latency: those measure the runner once workers share its cores. A generous ceiling that separates "finishes" from "hangs" is fine, and CPU time survives contention where wall clock does not. Where a measurement is unavoidably a benchmark, mark it `slow` -- knowing that nothing will run it -- rather than tuning its threshold.
+- In the default run, assert behavior rather than throughput or latency: those measure the runner once workers share its cores. A generous ceiling separating "finishes" from "hangs" is fine, and CPU time survives contention where wall clock does not. A measurement that only holds on a quiet machine, or that needs real hardware, belongs behind `slow` rather than at a tuned threshold.
- Hardware tests need explicit prerequisites and honest reporting of skips/unavailable devices. Passing mocked or CPU tests does not establish CUDA/ROCm/MPS/XPU behavior.
diff --git a/tests/app/util/test_video_thumbnails.py b/tests/app/util/test_video_thumbnails.py
index fe7cd7d91a..548b701e95 100644
--- a/tests/app/util/test_video_thumbnails.py
+++ b/tests/app/util/test_video_thumbnails.py
@@ -206,12 +206,13 @@ class TestStreamedDecoderIsBounded:
@pytest.mark.slow
def test_consumer_time_does_not_count_as_decoder_inactivity(self, synthetic_mp4: Path) -> None:
- """Marked slow: this one cannot be made robust under parallel execution.
+ """Marked slow: this one only holds on a quiet machine.
The decoder has to deliver its first frame inside the same window the consumer then
- sleeps past, so the test fails whenever FFmpeg startup is starved -- observed at 16 and
- 24 xdist workers, and still failing after the window was widened from 2s to 5s. Making
- it deterministic needs an injectable clock in the decoder rather than a larger number.
+ sleeps past, so it fails whenever FFmpeg startup is starved -- observed at 16 and 24 xdist
+ workers, and still failing after the window was widened from 2s to 5s. Widening it further
+ is not the answer; running it where nothing competes for the cores is, until an injectable
+ clock makes the accounting observable without a real timer.
"""
timeout = 5.0
frames = iter_video_frames(synthetic_mp4, timeout=timeout)