Skip to content

Record the Mermaid render result when the console isolation test fails - #546

Draft
raiseCatError wants to merge 1 commit into
devfrom
test/mermaid-render-result-message
Draft

raiseCatError wants to merge 1 commit into
devfrom
test/mermaid-render-result-message

Conversation

@raiseCatError

Copy link
Copy Markdown
Owner

What changed

tests/browserConsoleChrome.test.ts (test "a reload starts a new document; NMSh's find world, web pages and the Mermaid renderer never report"): when the assertion fails, it now prints the renderer's result. The assertion itself is unchanged:

assert.ok(result.ok || result.code === 'syntax', result.ok ? undefined : JSON.stringify(result));

On success the result carries the drawn PNG, so the message is only built when the render failed. The timeout (10 s) and the rest of the test are unchanged.

Why

This assertion fails intermittently on hosted macOS CI, and the failure output never shows which code the renderer returned (timeout, crashed or failed, from src/browser/engine/diagram.ts):

Neither PR touches browser or diagram code. Both durations are consistent with the 10 s render timeout, but the logs don't prove it. With this change, the next failure records the code and reason.

Verification

  • tsc --noEmit and git diff --check are clean.
  • One focused local run passed (4.6 s), but it did not exercise the renderer. Mermaid isn't installed on the local Mac and NMSH_TEST_MERMAID was unset, so locateMermaid returned not-ok and the test silently skipped the render step. CI installs Mermaid 12.2.0 for this test, so this PR's macOS CI shards are the run that matters.

No human terminal testing is needed; this changes test output only.

Hosted macOS CI has failed this assertion twice (runs 40630147755 and
43064876487) without saying which code the renderer returned. The
assertion is unchanged; on failure it now prints the result's code and
reason. A successful result carries the drawn picture, so the message
is only built when the render failed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant