test: honor SYNC_WAIT_MS in docker tests instead of clobbering it

tests/setup/per-fork-env.ts hardcoded SYNC_WAIT_MS=30000 on every fork, overriding whatever the container set, so the docker test image could never grant heavy ops a wider sync window. A 12MP stress-image enhance takes ~34s on the macOS Docker VM (Sharp runs 2-3x slower there), just past the 30s window, so the factory returned 202 and three sync-asserting image-enhancement tests failed.

Honor a higher SYNC_WAIT_MS when provided (30s floor preserved for host/CI), raise it to 120s in docker-compose.test.yml, and make the vitest test/hook timeouts env-overridable so a slow-but-correct job returns 200 rather than tripping a framework timeout. Host and CI behavior is unchanged.
This commit is contained in:
SnapOtter
2026-06-17 14:28:41 +08:00
parent 1f5b222267
commit 63a2d309ce
3 changed files with 23 additions and 7 deletions
+10 -3
View File
@@ -25,9 +25,16 @@ services:
- WORKSPACE_PATH=/tmp/test-workspace
- MAX_MEGAPIXELS=100
- RATE_LIMIT_PER_MIN=1000
# Single constrained container; give sync-wait tools more headroom before
# the factory falls back to async 202 (default is 8s).
- SYNC_WAIT_MS=30000
# The macOS Docker VM runs Sharp/FFmpeg ~2-3x slower than the host and
# oversubscribes CPU across parallel vitest forks, so heavy ops (e.g. a
# 12MP stress-image enhance) blow past the 30s test sync window and fall
# back to a 202 that sync-asserting tests reject. Give the sync window
# generous headroom (honored by tests/setup/per-fork-env.ts) and keep the
# framework test/hook timeouts above it so a slow-but-correct job returns
# 200 instead of tripping a vitest timeout. Host/CI keep the 30s defaults.
- SYNC_WAIT_MS=120000
- VITEST_TEST_TIMEOUT=180000
- VITEST_HOOK_TIMEOUT=120000
tmpfs:
- /tmp/test-workspace
- /tmp