ReviewOS

zig-utils/zig-js

Tests: update structuredClone nesting oracle for DOMException

#80
Closed chris opened this 9 days ago ·
9 days ago

Introduced by c45232db (feat(dom): add DOMException; structuredClone throws DataCloneError).

Linux CI unit shard 3 now deterministically fails structured clone nesting limit is catchable because the test still requires e instanceof TypeError, while the new and intended platform behavior is a DOMException with name === "DataCloneError".

Failure: https://github.com/zig-utils/zig-js/actions/runs/29338095020/job/87102490265

Acceptance:

  • keep the nesting-limit exception catchable;
  • assert the new public contract (instanceof DOMException, name === "DataCloneError", legacy code === DOMException.DATA_CLONE_ERR);
  • do not weaken the nesting-limit boundary or revert production structuredClone behavior;
  • run the exact focused test and push as a separate conventional test commit.
9 days ago

Fixed on main in 52f41b38 (test(clone): expect nesting DOMException (#80)). The nesting-limit witness now asserts the intended new platform contract: catchable DOMException, name === "DataCloneError", and code === DOMException.DATA_CLONE_ERR. Exact focused validation passed 2/2 with zero leaks; no production structured-clone behavior changed.

9 days ago

Combined replacement CI: https://github.com/zig-utils/zig-js/actions/runs/29338741409

9 days ago

Reopened: the current main run exposed a second stale oracle in the broad structuredClone unit test. Linux unit shard 1 still checks that cloning a function throws TypeError, while c45232d correctly changed that failure to a DataCloneError DOMException. I am updating the broad oracle to assert DOMException, name, and legacy code before pushing the focused follow-up.

9 days ago

Follow-up pushed to main as e78ae6c. It updates the remaining broad structuredClone function-rejection oracle to require DOMException, name === DataCloneError, and code === DOMException.DATA_CLONE_ERR. Focused result: 2/2 passed, 0 leaked. New main CI: https://github.com/zig-utils/zig-js/actions/runs/29340551356

9 days ago

Correction to the run link in the previous comment: the CI run for e78ae6c is https://github.com/zig-utils/zig-js/actions/runs/29339154198 (currently queued).

Sign in to comment on this issue.