Commit 9d28432
The web test runner (vendor/wheels/tests/runner.cfm) swaps the LIVE application.wheels
struct for test configuration (backup in application.$$$wheels) and restores it at the
end of the run. Overlapping test requests clobbered each other's backup, which could
restore TEST config as the live config until the next reload=true, or error the parent
run's restore outright (key [$$$WHEELS] doesn't exist).
Stage-1 slice of the issue-3025 analysis (the titled request-scoped overlay was ruled
infeasible in the 2026-06-22 adversarial analysis):
- Wrap the swap->run->restore window in an exclusive named cflock
('wheelsTestRunner_<applicationName>', timeout 1800s, throwOnTimeout), following the
swap-under-lock precedent in migrator/TenantMigrator.cfc.
- Re-entrancy guard: ParallelRunner partition sub-requests re-enter runner.cfm via fresh
top-level HTTP GETs while the parent holds the swap. They detect the already-applied
swap (application.$$$wheels exists) and skip BOTH the swap and the shared lock (a
unique per-request lock-name suffix), so parallel mode cannot deadlock.
- The restore now runs in a finally block, and only the request that created the backup
restores it — an erroring suite no longer leaves test config live. No loops in the
finally block (Lucee 7 miscompiles local-scoped loops in finally).
- Delete the orphaned legacy RocketUnit runner twin vendor/wheels/rocketunit_tests/Test.cfc
(nothing loads it; the Global.cfc scan-exclusion entry stays). The active CLI/legacy
chain via wheels.Test and $restoreTestRunnerApplicationScope is untouched.
New spec vendor/wheels/tests/specs/internal/TestRunnerSwapLockSpec.cfc: structural guard
for the lock acquisition + re-entrancy detection, and a behavioral nested-run test that
reproduced the backup clobber before the fix.
Residual gap (intentional, refs #3025): this serializes test-vs-test only. A normal
request concurrent with a test run still reads swapped config; true isolation is
deferred to a separate-application-context design.
Refs #3025
Signed-off-by: Peter Amiri <petera@pai.com>
Co-authored-by: Peter Amiri <petera@pai.com>
1 parent c8d24f0 commit 9d28432
4 files changed
Lines changed: 285 additions & 156 deletions
File tree
- changelog.d
- vendor/wheels
- rocketunit_tests
- tests
- specs/internal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
This file was deleted.
0 commit comments