Neilk1021 opened a new issue, #7998:
URL: https://github.com/apache/texera/issues/7998
### What happened?
`build / frontend (macos-latest, 24.19.0)` fails intermittently on:
```
FAIL
src/app/workspace/service/report-generation/report-generation.service.spec.ts
> ReportGenerationService > generateWorkflowSnapshot > rendering the
editor to a PNG
> fails when the editor cannot be rendered
Error: Test timed out in 20000ms.
```
The test had been running for 35,315 ms. ubuntu and windows pass on the same
commit.
**Cause.** The spec drives the real html2canvas, which clones the *whole
document*, not the
element it is pointed at. The unit-test builder runs spec files with
`isolate: false`, so one
jsdom document is shared by every spec file in a worker, and the clone drags
in whatever DOM the
files that ran before it left behind. How much that is depends on which
worker the file lands in
and what ran ahead of it, which is why the failure comes and goes and why
only the slowest leg
trips the 20s timeout.
From a failing job's log, the six renders in that file reported:
```
#1 22076ms #2 19823ms #3 13024ms #4 16028ms #5 12116ms #6 37281ms
Document cloned
```
against ~60 ms for the same file run on its own locally.
The same log carries **5,691** `Not implemented:
window.getComputedStyle(elt, pseudoElt)` stack
traces. jsdom does not implement the pseudo-element argument, so it emits a
`jsdomError` on the
virtual console (which vitest forwards to `console.error` as a full stack
trace) and then ignores
the argument. html2canvas does a `:before` and an `:after` lookup per cloned
node, so ~950 traces
per clone implies roughly 475 foreign elements in the document each time.
The same run locally
emits 56. jsdom's unimplemented `window.scrollTo` adds one trace per clone
on top.
This is a continuation of #7887 / #7886, which stopped the four
image-inlining tests in this file
waiting on the render. The flake has moved to the two tests that still await
one — and the four
renders those inlining tests start are not cancellable, so they run
concurrently with them.
### How to reproduce?
1. Open any PR and let `build / frontend (macos-latest, 24.19.0)` run; it
fails on a portion of runs.
2. Locally, the mechanism can be shown by seeding the shared document before
the render:
add `for (let i = 0; i < 500; i++)
document.body.appendChild(document.createElement("span"));`
to the `beforeEach` of the `rendering the editor to a PNG` describe and
run
`ng test --watch=false --include "**/report-generation.service.spec.ts"`.
Clone time across the file's six renders goes from ~0.5s to ~18.8s, with
~10,000 jsdom traces.
### Version/Branch
1.3.0-incubating-SNAPSHOT (main)
### Commit Hash (Optional)
444fc58284
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]