Retire stability test views before fixture deletion and retain failed acceptance

This commit is contained in:
zsviczian committed 2026-10-29 19:48:36 +01:00
1 parent 9c08d8148b
commit 098e6ee13d
10 files changed
+62391 -26

No files matched your search

+12 -1
View File
@@ -27,7 +27,7 @@ validated, and what remains uncertain.
| Phase | Status | Current outcome |
| --- | --- | --- |
| Assessment and baseline design | Complete | Initial architecture, risks, sequencing, and validation matrix documented |
| Automated test coverage (#3022) | Expanded acceptance in progress; foreground native runs paused | At plugin 38bf80fb / fork 053a3b9 / Extras 1cdcb7c, all 654 portable cases pass (56 new / 598 reused). Approved internal-preview focus correction passes four source regressions and isolated phone rendering/save/reopen with clean restoration. Earlier independent core 59 + focused nested-pane case and all 15 popout drop variants pass. Actual builds are installed/hash-verified in the prepared local vault; one-time trust is complete. Full scope remains 357 native cases including 258 behavioral obligations; zero of two complete repeats pass. Resume fresh runs when maintainer foreground access is free. See docs/TESTING.md |
| Automated test coverage (#3022) | Acceptance failed; focused diagnosis | At plugin 9c08d814 / fork 053a3b9 / Extras 1cdcb7c, all 654 portable cases pass (56 new / 598 reused). Exclusive unchanged text/pointer reruns pass. The full run passes all 258 behavioral and 40 device cases, but stability cycle 3 times out; cycles 4/5 and a passing error gate are missing. Eight illegal-access exceptions and one host delete-handler exception fail capture. Cleanup/restoration and negative controls pass. Test-only cleanup ordering is corrected with a regression and passive load snapshots; production is unchanged. Zero of two complete matching-build native repeats pass. See docs/TESTING.md |
| Template selection and cancellation (#2649, PR #3020) | Implemented; source and native selection/cancellation checks pass | A dedicated chooser returns template/blank/cancel, displays paths relative to the configured root, and initially selects explicit blank. Interactive callers resolve before folder/file/editor/leaf side effects. Public getBlankDrawing/createDrawing and EA/CLI contracts retain string/file returns and deterministic initData behavior |
| Nested-split fullscreen (#2743, PR #3020) | Implemented; seven source tests and native lower-right split pass | Keep the complete ancestor path visible; hide surrounding siblings and restore only owned classes. Native 958x641 drawing expands to 2560x1438 and returns to identical bounds. Existing inline styles remain untouched; controls are optional and cleanup retains the entry document across migration |
| Canvas preview scaling investigation (#2729, PR #3020) | Original SVG-only behavior not reproduced on Windows Obsidian 1.14.5; unresolved | Two nodes sharing a drawing scale independently in SVG, SVG-as-image and PNG with immersive mode on/off. Doubling one node width scales its preview by 2.0063; the other remains unchanged. Tall previews clip in all modes. No speculative rendering/cache change; retain measurements and keep the issue open |
@@ -3156,3 +3156,14 @@ remain strict pending maintainer classification; no production changes.
unfinished; rerun unchanged input assertions with exclusive access. No further
production changes. Highest-risk next checks remain complete phone/tablet and
popout workflows; physical touch and other desktop OSes remain separate.
- 2026-10-29 (#3022): Exclusive unchanged rerun passes all 16 text-history variants
and the first trusted desktop-pointer profile. Full attempt at 9c08d814 passes
all 258 behavior cases and 40 device/layout cases, but stability cycle 3 times
out and strict capture records eight illegal-access exceptions plus one host
onDelete parent-null exception. Cleanup/restoration and negative controls pass;
acceptance remains zero of two. Corrected the demonstrated test-only file-delete
cleanup race with an actual-function regression, and added passive load-state
evidence/focused stability selection. No production changes or gate waivers.
Highest-risk next checks are the large-scene reopen timeout and real popout
teardown exceptions; fresh full matching-build repeats remain required.
+1
View File
@@ -55,6 +55,7 @@ as passed service coverage.
| `npm run verify:obsidian:smoke` | Same current-workspace preparation, then focused editor startup |
| `npm run verify:obsidian -- --extras-services` | Same preparation; real MathJax/Mermaid gateways and a single native PDF export |
| `npm run verify:obsidian -- --behavior-matrix` | Same preparation; expanded desktop/main/split/nested/popout behavioral workflows |
| `npm run verify:obsidian -- --stability` | Same preparation; unchanged six large-scene save/reopen cycles with passive first-commit state snapshots |
| `npm run verify:obsidian:diagnostics` | Same fresh-build preparation, then the real unhandled-error negative control |
The historical `verify:obsidian:plugin` name is retained as a command alias; it
+12 -8
View File
@@ -3,7 +3,7 @@
## Current checkpoint (2026-10-29)
[Accessible sanitized case summaries and artifact manifests](testing-evidence/3022/README.md)
record the tested plugin `38bf80fb`, fork `053a3b9` and Extras `1cdcb7c`.
record the tested plugin `9c08d814`, fork `053a3b9` and Extras `1cdcb7c`.
Fresh portable verification passes **654 canonical cases (56 new, 598 reused)**.
The approved internal-preview focus correction passes four actual-method tests
and the isolated phone embedding workflow, with no window errors and successful
@@ -16,13 +16,17 @@ all **15 popout drop variants**, cleanup and baseline restoration; the core run
records zero unexpected errors/notifications. Native error/layout negative controls
pass. Real single-export PDF output is decoded and visually inspected.
Acceptance remains **incomplete**: **zero of two required complete native repeats**
have passed. The next full attempt was interrupted for the maintainer's foreground
PC access and is not counted. Its keyboard/pointer failures require an unchanged
rerun with exclusive access; interference is plausible, not established. The test
vault was restored with both plugins ready and no tasks, print roots or popouts.
Native input remains paused until the maintainer frees the machine. Do not merge
or substitute subset results for the 357-case gate.
Acceptance remains **failed**: **zero of two required complete native repeats**
have passed. Exclusive unchanged reruns pass all 16 text-history variants and the
desktop pointer profile; the prior failures remain retained without assuming their
cause. The next full attempt passes all 258 behavioral obligations and 40 device
profiles, but stability cycle 3 times out. Cycles 4/5 and the successful error gate
are missing. Eight illegal-access exceptions and one host onDelete parent-null
exception fail strict capture. Cleanup, baseline restoration and both negative
controls pass. The demonstrated test-only delete/detach race is corrected with a
regression; passive load snapshots and focused stability selection support the
remaining diagnosis. No production changes or diagnostic waivers. Do not merge or
substitute subset results for the 357-case gate.
The full plan has six native CLI-bearing cases (five editing plus Lucide) and two
separate mobile public `EA.executeCLI` workflows. Historical checkpoints below
retain their original scope and results.
+35
View File
@@ -307,3 +307,38 @@ no test tasks, print resources or popouts remain. This interrupted attempt is no
one of the two required complete repeats. Foreground tests remain on hold until
the maintainer signals availability. Independent background portable validation
passes 654 canonical cases (56 new / 598 reused), plus source/package gates.
## F19 - Exclusive input recheck and failed full acceptance at 9c08d814
The maintainer confirmed exclusive foreground access. The unchanged text-undo
scenario passes all 16 parsed/raw, keyboard/button variants, including parsed
keyboard wikilink redo and unchanged submission. The unchanged first desktop
trusted-pointer profile passes drawing, physical save and restoration. No window
or unexpected JavaScript errors occur in that focused rerun. The prior failures
remain preserved; foreground interference is plausible but not established.
Fresh portable verification at 9c08d814 / 053a3b9 / 1cdcb7c passes 654 canonical
cases and source/package gates. The next full `npm.cmd run test:native` attempt
passes all 258 behavioral obligations and all 40 device/layout profiles, but fails
`native:stability-roundtrip:3` waiting for the large scene's first commit. Cycles
4/5 and the successful JavaScript-error gate remain missing. Eight uncaught
`illegal access` exceptions and one Obsidian `children` null-reference exception
are retained and fail the gate. The two exact trusted ResizeObserver notifications
in popout Markdown reading settle under the existing bounded policy; no exclusion
was broadened. Cleanup, baseline restoration and both native negative controls
pass. This is not a complete passing repeat: acceptance remains zero of two.
## F20 - Stability failure cleanup races Obsidian's file-delete handler
The captured Obsidian 1.14.5 stack resolves to its file-view `onDelete` handler:
after awaiting an empty-file open, it still accesses the leaf parent's children.
The test deletes the open file and then detaches its leaf while that handler is
pending, making the parent null. A deterministic actual-function regression fails
with the old order and passes when the test retires its view/leaf before deleting
the fixture. This is a test-only cleanup correction; production is unchanged.
That correction does not establish the cause of the earlier first-commit timeout
or the eight `illegal access` exceptions. Added passive per-cycle load snapshots
and a focused `--stability` selector for diagnosis without changing the six-cycle,
1000-element, save/reopen, root-retirement, rendering or timeout assertions. Both
full repeats must use a new clean checkpoint after any test-tooling changes.
+15
View File
@@ -1,5 +1,20 @@
# Testing checkpoint: acceptance remains incomplete
Latest acceptance attempt: plugin `9c08d814`, fork `053a3b9`, Extras `1cdcb7c`.
Fresh portable validation passes 654 cases and source/package gates. Exclusive
unchanged text/pointer reruns pass. The subsequent full run passes all 258
behavioral cases and all 40 device/layout cases, but stability cycle 3 times out;
cycles 4/5 and the passing JavaScript-error gate are missing. Eight illegal-access
exceptions and one host onDelete exception remain failures. Cleanup/restoration
and both actual negative controls pass. **Zero of two complete repeats pass.**
[Sanitized failed acceptance, complete available cases and artifact manifests](acceptance-failed-9c08d814.json)
retains the evidence. The test-only file-delete/detach cleanup race has a
deterministic regression and correction; the initial load timeout and illegal
access still require focused diagnosis. No production fix, exclusion expansion,
or blind full-run retry is applied. A new clean checkpoint is required for both
full repeats after test-tooling corrections. Historical checkpoints follow.
Latest tested product: plugin `38bf80fbf42fe75784e31d9763fab35a3196b35c`,
fork `053a3b9f9e77917c457fce8ca9453d38b92a303b`, Extras
`1cdcb7c425a9b80afdc7b39c88861143b4b85e58`.
File diff suppressed because it is too large. Load diff
+12 -4
View File
@@ -14,7 +14,7 @@ export async function runStabilityScenario({cli,drawingPath,cycles=6}){
assert.ok(drawingPath.startsWith('__excalidraw_cli_smoke_'));
assert.ok(Number.isInteger(cycles)&&cycles>=2&&cycles<=25,'Bounded stability cycles');
const fixture=stabilityFixture(),path=drawingPath.replace(/\.(excalidraw\.md|excalidraw|md)$/,'')+'_stability.excalidraw.md';
const result=await runInAppTask({cli,execute:exerciseStability,args:[path,fixture,cycles],timeoutMs:cycles*30000+90000,cleanupMs:60000});
const result=await runInAppTask({cli,execute:exerciseStability,args:[path,fixture,cycles],timeoutMs:cycles*30000+90000,cleanupMs:60000,onProgress:(phase)=>console.log('[native] '+(phase||'stability starting'))});
return {id:'stability',status:'passed',fixtureHash:sha256(fixture),...result};
}
async function exerciseStability(c,path,fixture,cycles){
@@ -25,21 +25,29 @@ async function exerciseStability(c,path,fixture,cycles){
c.defer(async()=>{
const file=app.vault.getFileByPath(path);
if(leaf?.view?.excalidrawAPI&&leaf.view.isDirty())check((await leaf.view.saveWithOutcome()).status==='persisted','Stability cleanup save failed');
// Close the view first: file deletion invokes Obsidian's async onDelete,
// which still uses the leaf parent after its own awaited open(null).
if(leaf){const view=leaf.view;await leaf.setViewState({type:'empty',state:{}});leaf.detach();leaf=null;await c.waitForCleanup(()=>!view.excalidrawAPI&&!view.containerEl.querySelector('.excalidraw-wrapper'),'stability view retirement');}
if(file){check(path.startsWith('__excalidraw_cli_smoke_')&&file.path===path,'Unowned stability cleanup');await app.vault.delete(file);}
if(leaf){await c.waitForCleanup(()=>leaf.view.getViewType()!=='excalidraw'||!leaf.view.containerEl.isConnected,'stability view retirement');if(leaf.view.containerEl.isConnected)leaf.detach();}
if(previous?.view.containerEl.isConnected)app.workspace.setActiveLeaf(previous,{focus:true});
check(doc.querySelectorAll('.excalidraw-wrapper').length===beforeRoots,'Stability left an editor root');
});
const file=await app.vault.create(path,fixture);
await c.waitFor(()=>p.isExcalidrawFile(file),'large fixture metadata');
const timings=[],retired=[];
c.observations=[];
const loadState=()=>{const view=leaf?.view;return{at:Date.now(),leafId:leaf?.id,connected:view?.containerEl.isConnected,mainWindow:view?.containerEl.ownerDocument===doc,type:view?.getViewType?.(),file:view?.file?.path,isLoaded:view?.isLoaded,api:!!view?.excalidrawAPI,elements:view?.excalidrawAPI?.getSceneElements?.()?.length,justLoaded:view?.semaphores?.justLoaded,closing:view?.isClosingOrMigrating?.(),activeLeaf:app.workspace.activeLeaf?.id};};
for(let cycle=0;cycle<cycles;cycle++){
await c.case(`native:stability-roundtrip:${cycle}`,['P02','P07','P12'],async()=>{
const start=performance.now();
c.phase='stability cycle '+cycle+' opening';
const observation={cycle};c.observations.push(observation);
let anchor;app.workspace.iterateAllLeaves(l=>{if(!anchor&&l.getRoot()===app.workspace.rootSplit)anchor=l;});
check(anchor,'No main-window anchor');app.workspace.setActiveLeaf(anchor,{focus:true});
leaf=app.workspace.getLeaf('tab');await leaf.openFile(file);
await c.waitFor(()=>leaf.view.excalidrawAPI&&leaf.view.isLoaded&&!leaf.view.semaphores.justLoaded&&!leaf.view.isClosingOrMigrating(),'large scene first commit',60000);
observation.opened=loadState();
try{await c.waitFor(()=>leaf.view.excalidrawAPI&&leaf.view.isLoaded&&!leaf.view.semaphores.justLoaded&&!leaf.view.isClosingOrMigrating(),'large scene first commit',60000);}catch(error){observation.failed=loadState();throw error;}
observation.ready=loadState();c.phase='stability cycle '+cycle+' save and reopen';
const view=leaf.view,api=view.excalidrawAPI,elements=api.getSceneElements();
check(elements.length===1000,'Large scene lost elements');
check(elements.every((element,i)=>element.customData?.retainedUnknown?.value===i),'Large scene lost custom data');
@@ -67,5 +75,5 @@ async function exerciseStability(c,path,fixture,cycles){
return {assertions:['1000 elements and unknown custom data retained','physical save and Markdown preserved','fresh API and retired root','bounded scene/export duration'],durationMs:elapsed};
});
}
return {tests:c.tests,cycles,elements:1000,timingsMs:timings,limitations:'No forced-GC heap or physical-device performance claim; popout stress has its separate lifecycle lane.'};
return {tests:c.tests,cycles,elements:1000,timingsMs:timings,observations:c.observations,limitations:'No forced-GC heap or physical-device performance claim; popout stress has its separate lifecycle lane.'};
}
+128 -11
View File
@@ -1,12 +1,129 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import {stabilityFixture} from './stability.mjs';
test('large-scene stress stays bounded and deterministic with preserved prose and custom data',()=>{
const value=stabilityFixture();assert.equal(value,stabilityFixture());
const scene=JSON.parse(value.match(/```json\n([\s\S]*?)\n```/)[1]);
assert.equal(scene.elements.length,1000);assert.ok(value.includes('User Markdown retained.'));
assert.ok(Math.max(...scene.elements.map(e=>e.x+e.width))<5000);
assert.ok(Math.max(...scene.elements.map(e=>e.y+e.height))<2100);
assert.equal(scene.elements[999].customData.retainedUnknown.value,999);
assert.throws(()=>stabilityFixture(10000),/Bounded/);
import assert from "node:assert/strict";
import test from "node:test";
import { stabilityFixture } from "./stability.mjs";
import { readFileSync } from "node:fs";
import vm from "node:vm";
test("large-scene stress stays bounded and deterministic with preserved prose and custom data", () => {
const value = stabilityFixture();
assert.equal(value, stabilityFixture());
const scene = JSON.parse(value.match(/```json\n([\s\S]*?)\n```/)[1]);
assert.equal(scene.elements.length, 1000);
assert.ok(value.includes("User Markdown retained."));
assert.ok(Math.max(...scene.elements.map((e) => e.x + e.width)) < 5000);
assert.ok(Math.max(...scene.elements.map((e) => e.y + e.height)) < 2100);
assert.equal(scene.elements[999].customData.retainedUnknown.value, 999);
assert.throws(() => stabilityFixture(10000), /Bounded/);
});
test("failed stability loading retires the owned leaf before deleting its file", async () => {
const source = readFileSync(
new URL("./stability.mjs", import.meta.url),
"utf8",
);
const cleanup = [],
operations = [];
let detached = false,
closed = false,
removed = false;
const file = { path: "__excalidraw_cli_smoke_owned_stability.excalidraw.md" };
const doc = { querySelectorAll: () => [{}] };
const originalView = {
containerEl: { isConnected: true, querySelector: () => null },
excalidrawAPI: {},
isDirty: () => false,
getViewType: () => "excalidraw",
file,
isLoaded: false,
semaphores: { justLoaded: true },
isClosingOrMigrating: () => false,
};
const leaf = {
id: "owned",
view: originalView,
async openFile() {},
async setViewState(state) {
assert.equal(state.type, "empty");
closed = true;
originalView.excalidrawAPI = null;
operations.push("close");
this.view = {
containerEl: { isConnected: true },
getViewType: () => "empty",
};
},
detach() {
detached = true;
operations.push("detach");
this.view.containerEl.isConnected = false;
},
};
const anchor = {
getRoot: () => root,
view: { containerEl: { isConnected: true } },
},
root = {};
const app = {
plugins: {
plugins: {
"obsidian-excalidraw-plugin": { isExcalidrawFile: () => true },
},
},
workspace: {
containerEl: { ownerDocument: doc },
activeLeaf: anchor,
rootSplit: root,
iterateAllLeaves: (fn) => fn(anchor),
setActiveLeaf() {},
getLeaf: () => leaf,
},
vault: {
async create() {
return file;
},
getFileByPath: () => (removed ? null : file),
async delete() {
assert.equal(
closed,
true,
"Open file deletion can race Obsidian onDelete",
);
assert.equal(
detached,
true,
"Leaf retirement must complete before file deletion",
);
removed = true;
operations.push("delete");
},
},
};
const execute = vm.runInNewContext(
"(" +
source.slice(source.indexOf("async function exerciseStability")) +
")",
{ app, performance: { now: () => 0 } },
);
const c = {
defer: (fn) => cleanup.push(fn),
async waitFor(predicate, label) {
if (label === "large fixture metadata") {
assert.ok(predicate());
return;
}
assert.equal(label, "large scene first commit");
throw Error("owned first commit failure");
},
async waitForCleanup(predicate) {
assert.ok(predicate());
},
case: async (_id, _features, fn) => fn(),
};
await assert.rejects(
execute(c, file.path, "fixture", 6),
/owned first commit failure/,
);
assert.equal(cleanup.length, 1);
await cleanup[0]();
assert.equal(removed, true);
assert.deepEqual(operations, ["close", "detach", "delete"]);
});
+3 -1
View File
@@ -67,6 +67,7 @@ const extrasServices =
const devices =
fullProfile || profile === "devices" || process.argv.includes("--devices");
const textUndo = coreScenarios || process.argv.includes("--text-undo");
const stability = coreScenarios || profile === "soak" || process.argv.includes("--stability");
const nativeCLI = coreScenarios || process.argv.includes("--native-cli");
const embedRecovery = coreScenarios || process.argv.includes("--embed-recovery");
const groupedLinkClick =
@@ -126,6 +127,7 @@ const flags = [
"--workflow-fixes",
"--lucide",
"--text-undo",
"--stability",
"--native-cli",
"--embed-recovery",
"--grouped-link-click",
@@ -306,7 +308,7 @@ try {
...(coreScenarios ? [runAutomateScenario] : []),
...(coreScenarios ? [runCoreInteractionScenario] : []),
...(coreScenarios ? [runPDFImportScenario] : []),
...(coreScenarios || profile === "soak"
...(stability
? [
(context) =>
runStabilityScenario({
+1 -1
View File
@@ -2495,7 +2495,7 @@
},
{
"path": "scripts/testing/host/stability.test.mjs",
"mode": "direct-module-or-tooling"
"mode": "isolated-or-extracted"
},
{
"path": "scripts/testing/hostContracts.test.mjs",