mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Fix Index data visualizer sometimes shows wrong doc count for saved searches (#106007)
* [ML] Fix flaky saved search * [ML] Re-enable tests * [ML] Make data viz the only tests for flaky test suite runner * [ML] Make ML only * [ML] Remove describe.only Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
7101c42bec
commit
3b921cea56
2 changed files with 8 additions and 9 deletions
|
@ -65,20 +65,16 @@ export const DataVisualizerUrlStateContextProvider: FC<DataVisualizerUrlStateCon
|
|||
const parsedQueryString = parse(prevSearchString, { sort: false });
|
||||
|
||||
const getIndexPattern = async () => {
|
||||
if (typeof parsedQueryString?.index === 'string') {
|
||||
const indexPattern = await indexPatterns.get(parsedQueryString.index);
|
||||
setCurrentIndexPattern(indexPattern);
|
||||
}
|
||||
|
||||
if (typeof parsedQueryString?.savedSearchId === 'string') {
|
||||
const savedSearchId = parsedQueryString.savedSearchId;
|
||||
try {
|
||||
const savedSearch = await savedObjectsClient.get('search', savedSearchId);
|
||||
const indexPatternId = savedSearch.references.find((ref) => ref.type === 'index-pattern')
|
||||
?.id;
|
||||
if (indexPatternId !== undefined) {
|
||||
if (indexPatternId !== undefined && savedSearch) {
|
||||
try {
|
||||
const indexPattern = await indexPatterns.get(indexPatternId);
|
||||
setCurrentSavedSearch(savedSearch);
|
||||
setCurrentIndexPattern(indexPattern);
|
||||
} catch (e) {
|
||||
toasts.addError(e, {
|
||||
|
@ -88,7 +84,6 @@ export const DataVisualizerUrlStateContextProvider: FC<DataVisualizerUrlStateCon
|
|||
});
|
||||
}
|
||||
}
|
||||
setCurrentSavedSearch(savedSearch);
|
||||
} catch (e) {
|
||||
toasts.addError(e, {
|
||||
title: i18n.translate('xpack.dataVisualizer.index.savedSearchErrorMessage', {
|
||||
|
@ -98,6 +93,11 @@ export const DataVisualizerUrlStateContextProvider: FC<DataVisualizerUrlStateCon
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof parsedQueryString?.index === 'string') {
|
||||
const indexPattern = await indexPatterns.get(parsedQueryString.index);
|
||||
setCurrentIndexPattern(indexPattern);
|
||||
}
|
||||
};
|
||||
getIndexPattern();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
|
|
@ -496,8 +496,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
}
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/105087
|
||||
describe.skip('index based', function () {
|
||||
describe('index based', function () {
|
||||
this.tags(['mlqa']);
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/farequote');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue