Skip to content

[9.2]@kbn/cleanup-before-exit: don't pass in undefined exit code (#243499)#243579

Merged
jbudz merged 1 commit intoelastic:9.2from
jbudz:backport/243499/9.2
Nov 20, 2025
Merged

[9.2]@kbn/cleanup-before-exit: don't pass in undefined exit code (#243499)#243579
jbudz merged 1 commit intoelastic:9.2from
jbudz:backport/243499/9.2

Conversation

@jbudz
Copy link
Copy Markdown
Contributor

@jbudz jbudz commented Nov 19, 2025

…243499)

`@kbn/cleanup-before-exit` previously called `process.exit(exitCode)`
even when the exitCode is undefined. Passing in `undefined` actually
overrides a previously set `process.exitCode`. This unintentionally
causes the exitCode to be 0 when process.exitCode has been set to a
non-zero value. After elastic#228692 was
merged, `@kbn/cleanup-before-exit` became active for FTR runs because
`initMetrics` uses this function, and FTR uses `process.exitCode`, which
caused false positives in CI.

We're skipping test suites to allow the fix to roll in, and prevent
further unnoticed errors going to main.

Skipped suites / cases in:
- [ ] .buildkite/ftr_platform_stateful_configs.yml /
x-pack/performance/journeys_e2e/aiops_log_rate_analysis.ts
- [ ]
src/platform/test/api_integration/apis/dashboards/get_dashboard/main.ts
 - [x] src/platform/test/functional/apps/discover/group10/_lens_vis.ts
- [ ]
x-pack/platform/test/fleet_api_integration/apis/package_policy/delete.ts
- [ ]
x-pack/platform/test/functional_execution_context/tests/log_correlation.ts
- [ ]
x-pack/solutions/search/test/functional_search/tests/classic_navigation.basic.ts
- [ ]
x-pack/solutions/search/test/functional_search/tests/classic_navigation.ts
- [ ]
x-pack/solutions/security/test/api_integration/apis/cloud_security_posture/benchmark/v2.ts
- [ ]
x-pack/solutions/security/test/serverless/api_integration/test_suites/platform_security/authorization.ts
- [ ]
x-pack/platform/test/functional/apps/aiops/change_point_detection.ts
- [ ]
src/platform/test/api_integration/apis/metrics_experience/fields.ts
- [ ]
x-pack/solutions/security/test/security_solution_api_integration/test_suites/genai/attack_discovery/schedules/trial_license_complete_tier/find/find.ts
- [ ]
x-pack/platform/test/reporting_functional/reporting_and_security/management.ts

---------

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
Co-authored-by: Jonathan Budzenski <jon@elastic.co>
Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
@jbudz jbudz requested a review from kibanamachine as a code owner November 19, 2025 23:47
@jbudz jbudz added the backport This PR is a backport of another PR label Nov 19, 2025
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 19, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

@jbudz jbudz merged commit 1f19906 into elastic:9.2 Nov 20, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants