Skip to content

test(e2e): keep the crash output of a Ginkgo worker - #11674

Merged
litaocdl merged 3 commits into
mainfrom
dev/e2e-worker-crash-diagnostics
Oct 20, 2026
Merged

litaocdl merged 3 commits into
mainfrom
dev/e2e-worker-crash-diagnostics

Conversation

@mnencia

@mnencia mnencia commented Oct 16, 2026

Copy link
Copy Markdown
Member

When a parallel worker panics, Ginkgo reports only that a process disappeared. The panic text is lost because the output interceptor holds stderr while a spec runs, and the job summary says "0 Failure(s) Found!".

Each worker now copies its crash output to out/crash-proc<N>-<pid>.log and records its running spec in out/current-proc<N>-<pid>.txt, so a worker killed from outside still names the spec. Both files are removed on a clean exit and are collected with the failure artifacts. The report script prints them with any kernel OOM messages, and an empty Ginkgo report is named as such instead of "list index out of range".

Assisted-by: Claude

@mnencia
mnencia requested review from a team, NiccoloFei and litaocdl as code owners October 16, 2026 07:22
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.30 labels Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@mnencia
mnencia force-pushed the dev/e2e-worker-crash-diagnostics branch from 816d73f to 19fd1e9 Compare October 16, 2026 08:00
@mnencia

mnencia commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

Tested on kind with a temporary commit (reverted right after) that plants an unrecovered panic in a spec: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/38868387351

The worker died with exit status 2 and the Ginkgo CLI showed an empty "Output from proc 1", as in the original failure. With this change the job log and the test-failure-contexts artifact contain crash-proc1-<pid>.log, with the panic and the stack pointing at the planted line, and current-proc1-<pid>.txt, naming the spec. The summary says a worker probably died instead of only "0 Failure(s) Found!", and the generated artifact says the Ginkgo report is empty. The files of the healthy workers were removed on exit.

@NiccoloFei
NiccoloFei force-pushed the dev/e2e-worker-crash-diagnostics branch 2 times, most recently from c13a271 to 3ae3488 Compare October 19, 2026 13:05
@litaocdl
litaocdl force-pushed the dev/e2e-worker-crash-diagnostics branch from 3ae3488 to ee40191 Compare October 20, 2026 02:54
@litaocdl
litaocdl force-pushed the dev/e2e-worker-crash-diagnostics branch from ee40191 to a99c41a Compare October 20, 2026 07:20
@litaocdl

Copy link
Copy Markdown
Collaborator

/test ft=smoke

@github-actions

Copy link
Copy Markdown
Contributor

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Oct 20, 2026
When a parallel worker panics, Ginkgo reports only that a process
disappeared. The panic text is lost because the output interceptor
holds stderr while a spec runs, and the job summary says "0 Failure(s)
Found!".

Each worker now copies its crash output to out/crash-proc<N>-<pid>.log
and records its running spec in out/current-proc<N>-<pid>.txt, so a
worker killed from outside still names the spec. Both files are removed
on a clean exit and are collected with the failure artifacts. The report
script prints them with any kernel OOM messages, and an empty Ginkgo
report is named as such instead of "list index out of range".

Assisted-by: Claude
Signed-off-by: Marco Nenciarini <[email protected]>
This reverts commit 816d73f185c52a4d2e2505c0385acbf17b408a34.

Signed-off-by: Marco Nenciarini <[email protected]>
@litaocdl
litaocdl force-pushed the dev/e2e-worker-crash-diagnostics branch from a99c41a to 2ac6657 Compare October 20, 2026 08:28
@litaocdl
litaocdl merged commit 830a11d into main Oct 20, 2026
@litaocdl
litaocdl deleted the dev/e2e-worker-crash-diagnostics branch October 20, 2026 08:45
cnpg-bot pushed a commit that referenced this pull request Oct 20, 2026
When a parallel worker panics, Ginkgo reports only that a process
disappeared. The panic text is lost because the output interceptor holds
stderr while a spec runs, and the job summary says "0 Failure(s)
Found!".

Each worker now copies its crash output to `out/crash-proc<N>-<pid>.log`
and records its running spec in `out/current-proc<N>-<pid>.txt`, so a
worker killed from outside still names the spec. Both files are removed
on a clean exit and are collected with the failure artifacts. The report
script prints them with any kernel OOM messages, and an empty Ginkgo
report is named as such instead of "list index out of range".

Assisted-by: Claude

---------

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 830a11d)
cnpg-bot pushed a commit that referenced this pull request Oct 20, 2026
When a parallel worker panics, Ginkgo reports only that a process
disappeared. The panic text is lost because the output interceptor holds
stderr while a spec runs, and the job summary says "0 Failure(s)
Found!".

Each worker now copies its crash output to `out/crash-proc<N>-<pid>.log`
and records its running spec in `out/current-proc<N>-<pid>.txt`, so a
worker killed from outside still names the spec. Both files are removed
on a clean exit and are collected with the failure artifacts. The report
script prints them with any kernel OOM messages, and an empty Ginkgo
report is named as such instead of "list index out of range".

Assisted-by: Claude

---------

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 830a11d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases no-issue ok to merge 👌 This PR can be merged release-1.28 release-1.30

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants