kibana
kibana copied to clipboard
Failing test: X-Pack Cloud Security Posture API Tests.x-pack/test/cloud_security_posture_api/routes/benchmarks·ts - GET /internal/cloud_security_posture/benchmarks Get Benchmark API Verify cspm benchmark score is updated when muting rules
A test failed on a tracked branch
TypeError: Cannot read properties of undefined (reading 'metadata')
at getMockFinding (benchmarks.ts:59:16)
at Context.<anonymous> (benchmarks.ts:161:30)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Object.apply (wrap_function.js:73:16)
First failure: CI Build - main
Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)
New failure: CI Build - main
So this flakiness is caused by one of the function in the FTR. This function has the chance to return undefined (it does this randomly, I can only reproduce this on Flaky Test Runner and not locally), an easy way to go around this is by using mock benchmark rules instead of getting the fetching the benchmark rules from saved object (which can fail)
@animehart can you provide more context on what is the function you are talking about, how it was discovered that it can return undefined randomly?