Repository navigation
Description
What
mxcli test --local --watch keeps one mxbuild --serve process and one
runtime alive for the whole watch session and reuses that same serve
process for every rebuild (a test-file edit or a model change). On macOS
(confirmed on mxbuild 11.15.0), the second build in that process fails:
mxbuild reports IO_PathNotFound_Path for the regenerated page/layout
files it needs — the resource-key form of the same failure
run --local --watch's existing recovery already handles by its English
text (Could not find a part of the path). Because test --watch never
had that recovery wired in at all, every model change after the first in
a watch session reports ERROR the change could not be applied and the
loop never produces a verdict again until it's restarted.
Fix: route test --watch rebuilds through the same serveRecovery that
run --local --watch already uses (restart the serve process and rebuild
once more on this failure signature), teach the failure matcher to also
recognize the resource-key form (IO_PathNotFound_Path), including when
the target directory exists but the specific file mxbuild wants does not,
and add a headless mode so the test runner — nothing ever reads
web/dist in a test run — doesn't pay for the prebuilt-completeness
restart run --local --watch needs for its browser-facing client.
Why
Without this, a test --watch session is useless across a model edit on
macOS: the very next change after the first always errors, forever,
defeating the entire point of --watch (reload instead of boot per
change). Measured on a real ~280MB app
(~/mta-lab/w/w2test, a copy of sl1, 13 tests):
- Boot: 86s, 13/13 green.
- Model-change rebuild (seeded bug in
ACT_Invoice_Pay): 61s, correct
verdict (12/13, the seeded test red), 0 build-errors — before this fix,
this exact step reports "could not be applied" every time and never
reaches a verdict. - Model revert rebuild: 64s, back to 13/13 green.
(These are correctness measurements, not speed-up claims — the machine was
under heavy concurrent load, 1-minute average 46-64, during this run.)
How tested
- Unit tests for the two previously-untested edges this fix exercises:
TestServeRecovery_HeadlessSkipsPrebuiltRestart(headless must not pay
for a restart only a browser-facing client needs) and
TestLegacyClientBuildHintRecognizesMacOSKeyForm/
TestLegacyClientBuildHintMacOSKeyForm_DirExistsFileMissing(the
resource-key form of the failure, including the directory-exists/
file-missing edge case). - Real-app ABAB on a clean cherry-pick (see numbers above), plus the full
negative-control set: wrong@expectred (12/13), revert green (13/13),
seeded model bug red with a correct verdict (not an error), model revert
green, and a broken microflow (CE1613, retrieve from a deleted entity)
reported asErrors: 1, Passed: 0— never a pass. - Full
cmd/mxcli/dockerpackage suite: 2 pre-existing failures unrelated
to this change (TestSyncJavaDependencies_*, exercising the
orphan-pipe/Gradle-daemon watchdog injavadeps.go, a file this change
never touches) — confirmed environment-only:setsidis absent on this
machine, and the same test fails identically against vanilla
origin/mainwith zero code from this change applied.
Known limitation
This only recovers from the build failing in the prebuilt-client shape.
If mxbuild --serve itself dies (not just a failed build), test --watch
still needs a full session restart — out of scope for this change, which
only wires the existing run --local --watch recovery machinery into the
path test --watch never had it on.
Activity