kibana icon indicating copy to clipboard operation
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

Open kibanamachine opened this issue 11 months ago • 3 comments

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

kibanamachine avatar Apr 02 '24 12:04 kibanamachine

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

elasticmachine avatar Apr 02 '24 12:04 elasticmachine

New failure: CI Build - main

kibanamachine avatar Apr 12 '24 11:04 kibanamachine

Skipped.

main: 82fdf04

mistic avatar Apr 12 '24 17:04 mistic

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 avatar Jun 13 '24 01:06 animehart

@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?

maxcold avatar Jun 17 '24 09:06 maxcold