[CI/CD] Frontend Unit Tests intermittently hang in portlets-content-drive and hold CI for hours

Abierto
#38,553 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
github-actions, typescript
Área
ci-cd, testing

Línea de trabajo

Start by repeatedly running the Content Drive suite with the command in the reproduction steps, then use Vitest's hanging-process or verbose reporter to identify the last spec and open handle. The issue points to dot-content-drive-shell.component.spec.ts as prior teardown context but says the current culprit is unknown. Done means identifying and fixing the hang, getting 20 consecutive local runs and a week of CI runs without hangs, and adding a job timeout or Vitest teardown timeout.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Flakey Test Frontend Type : CI/CD
Problem Statement

Since 2026-11-06, the Frontend Unit Tests job intermittently hangs in the Content Drive test suite (portlets-content-drive). The job doesn't fail: it prints nothing more and runs until someone cancels it or the merge queue drops the PR, anywhere from about 15 minutes to almost 4 hours later. A normal run of the job takes about 20 to 25 minutes.

Any PR that changes libs/edit-content is exposed on every run, because Nx tests every project that depends on a changed one, and Content Drive depends on edit-content. One such PR (#38401) was ejected from the merge queue three times by this hang before it merged.

Evidence. Six hung runs across four PRs, all with the same signature:

  1. The last project to report done is edit-content (or another unrelated project), and then the step prints nothing until it's cancelled.
  2. In the job's uploaded test-report artifact (build-reports-test-Frontend Tests), core-web/target/core-web-reports/portlets-content-drive.xml exists but is 0 bytes. Content Drive's Vitest run started, and its reporter created the file, but it never finished writing results. No other unfinished project produced a report file.
Run PR Workflow Silent from → until cancelled (UTC)
42304344200 #38404 merge queue 11-06 22:47 (step start) → 11-07 02:37
42880697890 #38401 merge queue 11-10 19:24 → 20:20
42884775455 #38520 merge queue 11-10 19:48 → 20:02
42894367498 #38401 merge queue 11-10 20:58 → 21:52
42909252876 #38401 merge queue 11-10 22:13 → 11-11 02:03
43049294207 (attempt 2) #38400 PR checks 11-11 17:19 (step start) → cancelled after ~76 min

For comparison, the same job passed in 23 minutes on #38400 (run 41522933372) and in 20 minutes in the merge-queue run that merged #38401 (run 43064866163).

Probable cause (unconfirmed). The first hang is run 42304344200 (#38404) on 2026-11-06, the day after #38458 merged (2026-11-05 23:20 UTC). None of the merge queue's cancelled runs from Nov 4 to 6 before it shows the hang: each was cancelled in "Initial Artifact Build" or in the integration and Postman jobs, never in Frontend Unit Tests. That PR moved Vitest from 4.0.18 to 4.1.12. In the same change, commit 65f21563e1 mocked @dotcms/edit-content in dot-content-drive-shell.component.spec.ts (using vi.importActual) to stop a lazy side-panel import() from failing teardown. Its message says that failure already happened about one run in two under 4.0.18 ("Closing rpc while fetch was pending"), and that Vitest 4.1 reports it as EnvironmentTeardownError. One possibility is that a similar pending import or open handle elsewhere in the suite now keeps the worker alive instead of erroring. The exact spec file and handle haven't been identified.

Two things make the hang expensive and hard to see:

  • The Frontend Unit Tests job has no timeout, so a hang lasts until something outside cancels it.
  • Nx runs projects in parallel (parallel: 3) and prints each project's output only when it finishes. A hung project therefore leaves no output in the log, and only the empty report file points at it.
Steps to Reproduce
  1. On main (Vitest 4.1.12), run the Content Drive suite repeatedly:
    cd core-web && for i in $(seq 1 20); do pnpm nx test portlets-content-drive --skip-nx-cache || break; done
  2. Watch for a run that stops producing output and never exits. Running Vitest directly with --reporter=hanging-process (or --reporter=verbose) should name the open handle or the last spec file.
  3. In CI: open a PR that changes any file under core-web/libs/edit-content. About one run in three or four hangs in Frontend Unit Tests; check the run's artifact for an empty portlets-content-drive.xml.

Not yet reproduced locally. All evidence so far comes from CI.

Acceptance Criteria
  • The spec file and open handle that keep the Content Drive Vitest run alive are identified.
  • The Content Drive suite exits reliably: no hang in 20 consecutive local runs, and none in CI over a week of normal PR traffic.
  • The Frontend Unit Tests job has a timeout-minutes (or Vitest teardownTimeout), so any future hang fails within minutes instead of holding a runner or merge-queue slot for hours.
  • Optional: Nx streams each project's output in CI, so the hung project is visible in the log.
dotCMS Version

main as of 2026-11-11 (core-web on Vitest 4.1.12, since #38458)

Severity

Medium - Some functionality impacted

(CI only, no product impact. It repeatedly ejects PRs that change edit-content from the merge queue and ties up runners for hours. A retry usually passes.)

Links
  • NA (no Freshdesk ticket)
  • Vitest upgrade: #38458 (issue #38455), commit 65f21563e1
  • PRs affected: #38401, #38400, #38404, #38520
  • Found while landing #37996

🤖 Generated with Claude Code

Lenguaje dominante
Java
Estrellas
972
Forks
493
Merge medio
2 d 12 h
PR fusionados (30 d)
228

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotCMS/core

Todos los issues de dotCMS/core

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.