Skip to content

[EDR Workflows] Fix metadata transform race conditions and unskip flaky endpoint integration tests#261180

Merged
szwarckonrad merged 10 commits intoelastic:mainfrom
szwarckonrad:unskip-flaky-endpoint-integration-tests
Apr 7, 2026
Merged

[EDR Workflows] Fix metadata transform race conditions and unskip flaky endpoint integration tests#261180
szwarckonrad merged 10 commits intoelastic:mainfrom
szwarckonrad:unskip-flaky-endpoint-integration-tests

Conversation

@szwarckonrad
Copy link
Copy Markdown
Contributor

@szwarckonrad szwarckonrad commented Apr 3, 2026

Unskips two flaky endpoint integration FTR tests and fixes the underlying issues that caused them to fail.

Root causes:

  1. startMetadataTransforms() failed with resource_not_found_exception or TimeoutError because transforms weren't created yet or ES was slow on CI
  2. Test cleanup failed with 400 when deleting agent policies that Fleet still considered active
  3. Both tests used loadEndpointData() with full transforms/alerts/response-actions setup when they didn't need it, wasting timeout budget

Changes:

transforms.ts — shared infrastructure improvements:

  • Added waitForTransformsToBeCreated() that polls for transforms to exist before starting them (replaces one-shot lookup that raced with Fleet install)
  • Added startTransformWithRetry() that retries on 404 and TimeoutError with backoff
  • Both functions benefit all tests using startMetadataTransforms, not just the two being unskipped

index_fleet_endpoint_policy.ts:

  • Added force: true to agent policy deletion during test cleanup to avoid race with Fleet state

artifact_entries_list.ts (Closes #249124):

  • Unskipped
  • Replaced loadEndpointData() with a single event doc indexed into logs-endpoint.events.process-default to seed field mappings for the Event Filters autocomplete — the only data this test actually needs from ES

trusted_apps_list.ts (Closes #251545):

  • Unskipped
  • Removed loadEndpointData() entirely — this test only does UI CRUD with hardcoded values, no ES field queries

Closes #249124
Closes #251545

@szwarckonrad szwarckonrad added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Defend Workflows “EDR Workflows” sub-team of Security Solution labels Apr 3, 2026
@szwarckonrad szwarckonrad self-assigned this Apr 3, 2026
@szwarckonrad szwarckonrad added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Defend Workflows “EDR Workflows” sub-team of Security Solution labels Apr 3, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11373

[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/integrations.config.ts: 0/25 tests passed.
[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/serverless.integrations.config.ts: 24/25 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11375

[✅] x-pack/solutions/security/test/security_solution_endpoint/configs/integrations.config.ts: 1/1 tests passed.
[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/serverless.integrations.config.ts: 47/50 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11377

[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/integrations.config.ts: 48/50 tests passed.
[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/serverless.integrations.config.ts: 49/50 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#11379

[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/integrations.config.ts: 46/50 tests passed.
[❌] x-pack/solutions/security/test/security_solution_endpoint/configs/serverless.integrations.config.ts: 48/50 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#11398

[✅] x-pack/solutions/security/test/security_solution_endpoint/configs/integrations.config.ts: 2/2 tests passed.

see run history

@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#11399

[✅] x-pack/solutions/security/test/security_solution_endpoint/configs/integrations.config.ts: 50/50 tests passed.
[✅] x-pack/solutions/security/test/security_solution_endpoint/configs/serverless.integrations.config.ts: 50/50 tests passed.

see run history

@szwarckonrad szwarckonrad marked this pull request as ready for review April 6, 2026 22:34
@szwarckonrad szwarckonrad requested a review from a team as a code owner April 6, 2026 22:34
@szwarckonrad szwarckonrad requested review from joeypoon and pzl April 6, 2026 22:34
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #214 / discover/cascade layout grouping data fetching does not refetch when returning to a previously expanded group
  • [job] [logs] Scout: [ platform / alerting_v2 ] plugin / local-serverless-search - Discover Alerts menu with alerting v2 - should show Alerts menu with v2 ES|QL rule row and New badge
  • [job] [logs] Scout: [ platform / alerting_v2 ] plugin / local-serverless-security_complete - Discover Alerts menu with alerting v2 - should show Alerts menu with v2 ES|QL rule row and New badge

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 748 749 +1

Total ESLint disabled count

id before after diff
securitySolution 853 854 +1

History

cc @szwarckonrad

Copy link
Copy Markdown
Member

@joeypoon joeypoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♂️

@szwarckonrad szwarckonrad merged commit f21bf0e into elastic:main Apr 7, 2026
21 checks passed
szwarckonrad added a commit that referenced this pull request Apr 7, 2026
…#261845)

The artifacts regrouping PR (#257001) reorganized all endpoint artifacts
into a unified page with tabs. This changed the page structure so that
`header-page-title` now belongs to the unified "Artifacts" page and is
always present, regardless of whether individual tabs have entries.

Previously, `trusted_apps_list.ts` was skipped (flaky). Our PR #261180
unskipped it after fixing the underlying flakiness — but by that point
the regrouping had already landed, making the `header-page-title`
assertions invalid. The test immediately started failing on merge.

`artifact_entries_list.ts` has the same `header-page-title` assertions
for all artifact types (trusted apps, event filters, blocklist, host
isolation exceptions) — these would fail for the same reason once hit.

**Fix:** Replace `missingOrFail('header-page-title')` with
`existOrFail('*-emptyState')` in both test files. The empty state test
subject is the correct indicator that a tab has no entries.

Closes #261827
Closes #261829
Closes #261833
Closes #261849
Closes #261850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v9.4.0

Projects

None yet

4 participants