[Entity Analytics] Fix CSV upload test to stop automated-resolution maintainer#264061
[Entity Analytics] Fix CSV upload test to stop automated-resolution maintainer#264061
Conversation
…aintainer After PR #263732 (init on install), entity maintainers are initialized during the Entity Store install flow. The CSV upload test relied on maintainers not being initialized, causing a race condition where the automated-resolution maintainer links entities before the test can assert. Stop the maintainer explicitly in the before hook with a try/catch for backward compatibility.
Catch flakiness early (recommended)Recommended before merge: run the flaky test runner against this PR to catch flakiness early. Trigger a run with the Flaky Test Runner UI or post this comment on the PR: This check is experimental. Share your feedback in the #appex-qa channel. Posted via Macroscope — Flaky Test Runner nudge |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
|
|
/flaky ftrConfig:x-pack/solutions/security/test/security_solution_api_integration/test_suites/entity_analytics/entity_resolution/trial_license_complete_tier/configs/ess.config.ts:30 |
|
/flaky ftrConfig:x-pack/solutions/security/test/security_solution_api_integration/test_suites/entity_analytics/entity_resolution/trial_license_complete_tier/configs/serverless.config.ts:30 |
Flaky Test Runner✅ Build triggered - kibana-flaky-test-suite-runner#11708
|
Flaky Test Runner Stats🎉 All tests passed! - kibana-flaky-test-suite-runner#11708[✅] x-pack/solutions/security/test/security_solution_api_integration/test_suites/entity_analytics/entity_resolution/trial_license_complete_tier/configs/serverless.config.ts: 30/30 tests passed. |
|
Pinging @elastic/security-entity-analytics (Team:Entity Analytics) |
|
closing as this change already a part of #263732 |
Summary
Fixes the FTR test
should link matching entities to a targetinresolution_csv_upload.tsthat is consistently failing after PR #263732 (init on install).PR #263732 moved entity maintainers initialization into the Entity Store install flow. The CSV upload test previously relied on
enableEntityStoreV2()(without maintainer init) to prevent theautomated-resolutionmaintainer from racing with test assertions. With the new behavior, maintainers are initialized during install regardless, so the test now explicitly stops theautomated-resolutionmaintainer in thebeforehook.The
stopMaintainercall is wrapped in a try/catch for backward compatibility — on builds where #263732 hasn't merged yet, the maintainer task may not exist and the stop call is safely ignored.Related: #263732, #263728
Checklist
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Low risk — test-only change. Adds a
stopMaintainercall in the testbeforehook with a try/catch fallback, so it's a no-op when the maintainer doesn't exist.