mengw15 opened a new issue, #7887:
URL: https://github.com/apache/texera/issues/7887

   ### What happened
   
   `report-generation.service.spec.ts > generateWorkflowSnapshot > inlining the 
editor's images > reports an image that cannot be fetched at all` fails on the 
macOS frontend job with
   
   ```
   Error: Test timed out in 20000ms.
   ```
   
   It is intermittent and platform-skewed: on the same `main` code, the macOS 
job passed on #7655 and #7840 and failed on #7877. ubuntu and windows have not 
been seen failing.
   
   ### Why
   
   The four tests in that block wait on `generateWorkflowSnapshot`'s observable:
   
   ```ts
   service.generateWorkflowSnapshot("myflow").subscribe({ next: resolve, error: 
resolve });
   ```
   
   but the service only emits after the render:
   
   ```ts
   Promise.all(imagePromises)                   // the image inlining these 
tests assert on
     .then(() => html2canvas(element, { ... })) // next/error come only after 
this settles
     .then(canvas => { observer.next(canvas.toDataURL("image/png")); 
observer.complete(); })
     .catch(error => observer.error(error));
   ```
   
   So each test's completion depends on html2canvas finishing inside jsdom, 
which has no time bound — while the assertions (the rewritten `href`, the 
logged `console.error`) are already true one step earlier. On ubuntu and 
windows html2canvas fails fast (`Error parsing CSS component value, unexpected 
EOF` against jsdom's empty computed styles) and the promise settles quickly; on 
a slower macOS runner it did not settle within the 20s test timeout.
   
   That the block spent 20s at all is the tell — the work it was waiting for is 
unrelated to what it asserts.
   
   ### Fix
   
   #7886 stops the tests waiting on the render: the snapshot is started and 
each test waits for its own effect instead. The spec's tests drop from 20.6s 
(timing out) to 348ms, with the service's coverage unchanged at 129/129 
statements.
   
   Introduced by #7541.
   


-- 
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]

Reply via email to