mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Saved Object APIs - FTR - Fix flaky test in _find
API (#160794)
## Summary Attempt to fix https://github.com/elastic/kibana/issues/156581 The best explanation I have is that the two retrieved visualisations are not necessarily retrieved in the expected order. Sorting the results should ensure the expected order. Will use the flaky test runner to check the fix.
This commit is contained in:
parent
bbccd9e688
commit
4e3f6990c2
1 changed files with 4 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import { sortBy } from 'lodash';
|
||||
import { MAIN_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
|
||||
import expect from '@kbn/expect';
|
||||
import { SavedObject } from '@kbn/core/server';
|
||||
|
@ -153,8 +154,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
}));
|
||||
});
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/156581
|
||||
describe.skip('wildcard namespace', () => {
|
||||
describe('wildcard namespace', () => {
|
||||
it('should return 200 with individual responses from the all namespaces', async () =>
|
||||
await supertest
|
||||
.get(
|
||||
|
@ -165,7 +165,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const knownDocuments = resp.body.saved_objects.filter((so: { namespaces: string[] }) =>
|
||||
so.namespaces.some((ns) => [SPACE_ID, `${SPACE_ID}-foo`].includes(ns))
|
||||
);
|
||||
const [obj1, obj2] = knownDocuments.map(
|
||||
|
||||
const [obj1, obj2] = sortBy(knownDocuments, 'namespaces').map(
|
||||
({ id, originId, namespaces }: SavedObject) => ({ id, originId, namespaces })
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue