Skip to content

Commit 5fb6fdc

Browse files
Only check that the event ids are the same in arrays (#72624)
1 parent 8c55e48 commit 5fb6fdc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

x-pack/test/api_integration/apis/endpoint/resolver.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import {
1717
ResolverNodeStats,
1818
ResolverRelatedAlerts,
1919
} from '../../../../plugins/security_solution/common/endpoint/types';
20-
import { parentEntityId } from '../../../../plugins/security_solution/common/endpoint/models/event';
20+
import {
21+
parentEntityId,
22+
eventId,
23+
} from '../../../../plugins/security_solution/common/endpoint/models/event';
2124
import { FtrProviderContext } from '../../ftr_provider_context';
2225
import {
2326
Event,
@@ -167,10 +170,14 @@ const compareArrays = (
167170
if (lengthCheck) {
168171
expect(expected.length).to.eql(toTest.length);
169172
}
173+
170174
toTest.forEach((toTestEvent) => {
171175
expect(
172176
expected.find((arrEvent) => {
173-
return JSON.stringify(arrEvent) === JSON.stringify(toTestEvent);
177+
// we're only checking that the event ids are the same here. The reason we can't check the entire document
178+
// is because ingest pipelines are used to add fields to the document when it is received by elasticsearch,
179+
// therefore it will not be the same as the document created by the generator
180+
return eventId(toTestEvent) === eventId(arrEvent);
174181
})
175182
).to.be.ok();
176183
});

0 commit comments

Comments
 (0)