Flaky: RichTextEsheetModes Escape-dismissal tests fail intermittently on CI

Aperta Adatta ai principianti
#794 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
77/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
playwright, react, typescript
Ambito
testing

Direzione di ricerca

Inizia dai due test di chiusura con Escape in src/components/RichTextEsheet/RichTextEsheetModes.test.tsx, intorno alle righe 446 e 470, poi esamina i test vicini sui layer Escape nello stesso blocco describe. Esegui il file con pnpm test e verifica se le asserzioni successive a Escape entrano in competizione con lo smontaggio dell’overlay. Il lavoro è completato quando le asserzioni di chiusura attendono lo smontaggio e i test passano in modo affidabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

What happened

Two tests in src/components/RichTextEsheet/RichTextEsheetModes.test.tsx failed the Unit Tests job on an unrelated PR (#700, SuperChat attachment plumbing that never touches RichTextEsheet, Modal, or Escape handling), then passed on a plain re-run of the same commit.

Failed run: https://github.com/mieweb/ui/actions/runs/44657857336/job/136028422423

  • RichTextEsheet mode synchronization > closes the resolver with Escape inside an enclosing host dialog (line ~446)
  • RichTextEsheet mode synchronization > dismisses one overlay layer per Escape inside a library Modal host (line ~470)

Both failed the same way: expect(element).not.toBeInTheDocument() found the resolver dialog still mounted after Escape, meaning the dismissal had not completed when the assertion ran.

Evidence it is a flake, not the PR

  • The exact merged tree CI tested (main + #700) was rebuilt locally: pnpm test (2,778 tests), pnpm test:coverage, and three isolated runs of this file all passed.
  • The CI re-run of the same head went green with no code change.
  • The tests arrived on main via #762 and #775; #700 does not touch any file they exercise.

Impact

Until stabilized, these tests will randomly fail the Unit Tests job on unrelated PRs and erode trust in red CI.

Suspected cause and suggested fix

The assertions race the overlay teardown on slower CI runners. Likely fixes: wrap the post-Escape assertions in waitFor/waitForElementToBeRemoved instead of asserting synchronously after the keyboard event, or flush the relevant timers/transitions before asserting. Worth auditing the neighboring Escape-layer tests in the same describe block for the same pattern while in there.

Lingua principale
TypeScript
Stelle
2
Fork
7
Merge medio
1g 12h
PR unite (30g)
62

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mieweb/ui

Tutte le issue di mieweb/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.