From e2e4a7fe1390edf4542cec9948a3d8e630df5917 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Fri, 6 Nov 2020 19:46:49 +0100 Subject: [PATCH 01/10] Unskip date_nanos test, add debugging --- .../index_patterns/index_patterns.ts | 24 +++++++++++++++++-- test/functional/apps/discover/_date_nanos.js | 4 +++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index aae9b89cdc61..d380d1df0422 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -200,7 +200,7 @@ export class IndexPatternsService { return true; } - return Object.values(specs).every((spec) => { + const isFieldRefreshRequired = Object.values(specs).every((spec) => { // See https://github.com/elastic/kibana/pull/8421 const hasFieldCaps = 'aggregatable' in spec && 'searchable' in spec; @@ -209,6 +209,11 @@ export class IndexPatternsService { return !hasFieldCaps || !hasDocValuesFlag; }); + if (isFieldRefreshRequired) { + // eslint-disable-next-line no-console + console.log('isFieldRefreshRequired == true for specs', JSON.stringify(specs)); + } + return isFieldRefreshRequired; } /** @@ -380,15 +385,23 @@ export class IndexPatternsService { params: typeMeta && typeMeta.params, }) : spec.fields; + if (isFieldRefreshRequired) { + // eslint-disable-next-line no-console + console.log('fields fetched', JSON.stringify(spec.fields)); + } } catch (err) { isSaveRequired = false; if (err instanceof IndexPatternMissingIndices) { + // eslint-disable-next-line no-console + console.error('index pattern missing', JSON.stringify(err)); this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert', }); } else { + // eslint-disable-next-line no-console + console.error('fields fetching not possible', JSON.stringify(err)); this.onError(err, { title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', @@ -406,6 +419,8 @@ export class IndexPatternsService { indexPatternCache.set(id, indexPattern); if (isSaveRequired) { try { + // eslint-disable-next-line no-console + console.error('updateSavedObject starts', JSON.stringify(spec.fields)); this.updateSavedObject(indexPattern); } catch (err) { this.onError(err, { @@ -420,7 +435,10 @@ export class IndexPatternsService { }); } } - + if (isFieldRefreshRequired) { + // eslint-disable-next-line no-console + console.error('resetOriginalSavedObjectBode', JSON.stringify(spec.fields)); + } indexPattern.resetOriginalSavedObjectBody(); return indexPattern; }; @@ -517,6 +535,8 @@ export class IndexPatternsService { .then((resp) => { indexPattern.id = resp.id; indexPattern.version = resp.version; + // eslint-disable-next-line no-console + console.error('index pattern saved successfully'); }) .catch(async (err) => { if (err?.res?.status === 409 && saveAttempts++ < MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS) { diff --git a/test/functional/apps/discover/_date_nanos.js b/test/functional/apps/discover/_date_nanos.js index 9b076c821575..30c1d0be144a 100644 --- a/test/functional/apps/discover/_date_nanos.js +++ b/test/functional/apps/discover/_date_nanos.js @@ -28,7 +28,9 @@ export default function ({ getService, getPageObjects }) { const toTime = 'Sep 23, 2019 @ 03:31:44.000'; // Failing: See https://github.com/elastic/kibana/issues/82035 - describe.skip('date_nanos', function () { + + // eslint-disable-next-line mocha/no-exclusive-tests + describe.only('date_nanos', function () { before(async function () { await esArchiver.loadIfNeeded('date_nanos'); await kibanaServer.uiSettings.replace({ defaultIndex: 'date-nanos' }); From 2753c41f643da89ccc008dd6b16b0609fc21c884 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Sat, 7 Nov 2020 05:36:26 +0100 Subject: [PATCH 02/10] Remove describe.only --- test/functional/apps/discover/_date_nanos.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/functional/apps/discover/_date_nanos.js b/test/functional/apps/discover/_date_nanos.js index 30c1d0be144a..7e2ef604f4b1 100644 --- a/test/functional/apps/discover/_date_nanos.js +++ b/test/functional/apps/discover/_date_nanos.js @@ -29,8 +29,7 @@ export default function ({ getService, getPageObjects }) { // Failing: See https://github.com/elastic/kibana/issues/82035 - // eslint-disable-next-line mocha/no-exclusive-tests - describe.only('date_nanos', function () { + describe('date_nanos', function () { before(async function () { await esArchiver.loadIfNeeded('date_nanos'); await kibanaServer.uiSettings.replace({ defaultIndex: 'date-nanos' }); From 1ba5c40d7193a63ecef52e6c4006317a9cbc4a52 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Sat, 7 Nov 2020 09:26:25 +0100 Subject: [PATCH 03/10] Add more logs --- .../common/index_patterns/index_patterns/index_patterns.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index d380d1df0422..aee91d68b253 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -222,12 +222,15 @@ export class IndexPatternsService { */ getFieldsForWildcard = async (options: GetFieldsOptions = {}) => { const metaFields = await this.config.get(UI_SETTINGS.META_FIELDS); - return this.apiClient.getFieldsForWildcard({ + const result = this.apiClient.getFieldsForWildcard({ pattern: options.pattern, metaFields, type: options.type, params: options.params || {}, }); + // eslint-disable-next-line no-console + console.log('getFieldsForWildcard returns', JSON.stringify(result)); + return result; }; /** From 1efd766f35ae2f7a2d4d82a7999c74cf0c583a6d Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Sun, 8 Nov 2020 22:39:58 +0100 Subject: [PATCH 04/10] Fix flaky refresh test --- test/functional/apps/discover/_discover.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/functional/apps/discover/_discover.js b/test/functional/apps/discover/_discover.js index e597cc14654b..8b566263d6a6 100644 --- a/test/functional/apps/discover/_discover.js +++ b/test/functional/apps/discover/_discover.js @@ -304,10 +304,14 @@ export default function ({ getService, getPageObjects }) { const getRequestTimestamp = async () => { const requestStats = await inspector.getTableData(); - const requestTimestamp = requestStats.filter((r) => - r[0].includes('Request timestamp') - )[0][1]; - return requestTimestamp; + const requestStatsRow = requestStats.filter( + (r) => r && r[0] && r[0].includes('Request timestamp') + ); + if (!requestStatsRow || !requestStatsRow[0] || !requestStatsRow[0][1]) { + return ''; + } + + return requestStatsRow[0][1]; }; const requestTimestampBefore = await getRequestTimestamp(); @@ -316,7 +320,7 @@ export default function ({ getService, getPageObjects }) { log.debug( `Timestamp before: ${requestTimestampBefore}, Timestamp after: ${requestTimestampAfter}` ); - return requestTimestampBefore !== requestTimestampAfter; + return requestTimestampAfter && requestTimestampBefore !== requestTimestampAfter; }); }); From 37be57db72cbfd6f8eb28b32558d6cbfa3d1ce8e Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Mon, 9 Nov 2020 13:11:35 +0100 Subject: [PATCH 05/10] Add even more logs --- .../index_patterns/index_patterns/index_patterns.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index aee91d68b253..6c806ab2b8dd 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -228,8 +228,6 @@ export class IndexPatternsService { type: options.type, params: options.params || {}, }); - // eslint-disable-next-line no-console - console.log('getFieldsForWildcard returns', JSON.stringify(result)); return result; }; @@ -255,6 +253,8 @@ export class IndexPatternsService { refreshFields = async (indexPattern: IndexPattern) => { try { const fields = await this.getFieldsForIndexPattern(indexPattern); + // eslint-disable-next-line no-console + console.log('refreshFields returns', JSON.stringify(fields)); const scripted = indexPattern.getScriptedFields().map((field) => field.spec); indexPattern.fields.replaceAll([...fields, ...scripted]); } catch (err) { @@ -287,7 +287,12 @@ export class IndexPatternsService { const scriptdFields = Object.values(fields).filter((field) => field.scripted); try { const newFields = await this.getFieldsForWildcard(options); - return this.fieldArrayToMap([...newFields, ...scriptdFields]); + // eslint-disable-next-line no-console + console.log('getFieldsForWildcard returns', JSON.stringify(newFields)); + const result = this.fieldArrayToMap([...newFields, ...scriptdFields]); + // eslint-disable-next-line no-console + console.log('fieldArrayToMap returns', JSON.stringify(result)); + return result; } catch (err) { if (err instanceof IndexPatternMissingIndices) { this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); From 287e833ecb18154672df29a3e880c5a760859c56 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Mon, 9 Nov 2020 16:12:30 +0100 Subject: [PATCH 06/10] Add even more logs --- .../common/index_patterns/index_patterns/index_patterns.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index 6c806ab2b8dd..ea2b72adca98 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -284,6 +284,8 @@ export class IndexPatternsService { title: string, options: GetFieldsOptions ) => { + // eslint-disable-next-line no-console + console.log('refreshFieldSpecMap start'); const scriptdFields = Object.values(fields).filter((field) => field.scripted); try { const newFields = await this.getFieldsForWildcard(options); @@ -294,6 +296,8 @@ export class IndexPatternsService { console.log('fieldArrayToMap returns', JSON.stringify(result)); return result; } catch (err) { + // eslint-disable-next-line no-console + console.log('refreshFieldSpecMap ERROR', JSON.stringify(err)); if (err instanceof IndexPatternMissingIndices) { this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); return {}; From 343c1864086252c835021dcc3ddedb5347c11414 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Tue, 10 Nov 2020 14:56:42 +0100 Subject: [PATCH 07/10] Unskip more tests --- test/functional/apps/discover/_doc_navigation.js | 6 ++---- test/functional/apps/discover/_field_data.js | 3 +-- test/functional/apps/discover/_inspector.js | 3 +-- test/functional/apps/discover/_shared_links.js | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/test/functional/apps/discover/_doc_navigation.js b/test/functional/apps/discover/_doc_navigation.js index 31aef96918ff..57242dddf71a 100644 --- a/test/functional/apps/discover/_doc_navigation.js +++ b/test/functional/apps/discover/_doc_navigation.js @@ -28,13 +28,11 @@ export default function ({ getService, getPageObjects }) { const esArchiver = getService('esArchiver'); const retry = getService('retry'); - // FLAKY: https://github.com/elastic/kibana/issues/78373 - describe.skip('doc link in discover', function contextSize() { + describe('doc link in discover', function contextSize() { beforeEach(async function () { log.debug('load kibana index with default index pattern'); - await esArchiver.loadIfNeeded('discover'); - await esArchiver.loadIfNeeded('logstash_functional'); + await esArchiver.loadIfNeeded('discover'); await PageObjects.common.navigateToApp('discover'); await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.discover.waitForDocTableLoadingComplete(); diff --git a/test/functional/apps/discover/_field_data.js b/test/functional/apps/discover/_field_data.js index 118234d54626..d45b8f4841cb 100644 --- a/test/functional/apps/discover/_field_data.js +++ b/test/functional/apps/discover/_field_data.js @@ -27,8 +27,7 @@ export default function ({ getService, getPageObjects }) { const queryBar = getService('queryBar'); const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize', 'timePicker']); - // FLAKY: https://github.com/elastic/kibana/issues/78689 - describe.skip('discover tab', function describeIndexTests() { + describe('discover tab', function describeIndexTests() { this.tags('includeFirefox'); before(async function () { await esArchiver.loadIfNeeded('logstash_functional'); diff --git a/test/functional/apps/discover/_inspector.js b/test/functional/apps/discover/_inspector.js index fcb66fbd52cf..900ad28e14e6 100644 --- a/test/functional/apps/discover/_inspector.js +++ b/test/functional/apps/discover/_inspector.js @@ -34,8 +34,7 @@ export default function ({ getService, getPageObjects }) { return hitsCountStatsRow[STATS_ROW_VALUE_INDEX]; } - // FLAKY: https://github.com/elastic/kibana/issues/39842 - describe.skip('inspect', () => { + describe('inspect', () => { before(async () => { await esArchiver.loadIfNeeded('logstash_functional'); await esArchiver.load('discover'); diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 56c648562404..94409a94e925 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects }) { const browser = getService('browser'); const toasts = getService('toasts'); - // FLAKY: https://github.com/elastic/kibana/issues/80104 - describe.skip('shared links', function describeIndexTests() { + describe('shared links', function describeIndexTests() { let baseUrl; async function setup({ storeStateInSessionStorage }) { From d3b502b7e25b3ba50630317a3ff8fbda1184c484 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Tue, 10 Nov 2020 19:17:17 +0100 Subject: [PATCH 08/10] Add more console.log --- .../index_patterns/index_patterns.ts | 7 +------ .../index_patterns_api_client.ts | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index ea2b72adca98..dfd37262bdee 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -289,12 +289,7 @@ export class IndexPatternsService { const scriptdFields = Object.values(fields).filter((field) => field.scripted); try { const newFields = await this.getFieldsForWildcard(options); - // eslint-disable-next-line no-console - console.log('getFieldsForWildcard returns', JSON.stringify(newFields)); - const result = this.fieldArrayToMap([...newFields, ...scriptdFields]); - // eslint-disable-next-line no-console - console.log('fieldArrayToMap returns', JSON.stringify(result)); - return result; + return this.fieldArrayToMap([...newFields, ...scriptdFields]); } catch (err) { // eslint-disable-next-line no-console console.log('refreshFieldSpecMap ERROR', JSON.stringify(err)); diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts index 377a3f7f91a5..d36c07a42551 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts @@ -80,7 +80,23 @@ export class IndexPatternsApiClient implements IIndexPatternsApiClient { meta_fields: metaFields, }; } + // eslint-disable-next-line no-console + console.log('API client url', url); + // eslint-disable-next-line no-console + console.log('API client query', JSON.stringify(query)); - return this._request(url, query).then((resp: any) => resp.fields); + return this._request(url, query) + .then((resp: any) => { + // eslint-disable-next-line no-console + console.log('API client url response', JSON.stringify(resp)); + return resp.fields; + }) + .catch((e) => { + // eslint-disable-next-line no-console + console.error('API client Error Message', e.message); + // eslint-disable-next-line no-console + console.error('API client Error', JSON.stringify(e)); + throw new Error('API client ERROR'); + }); } } From d15b5f12f5fc15185309e111bc6c894b2f7fb1aa Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Wed, 11 Nov 2020 08:48:50 +0100 Subject: [PATCH 09/10] Add more console.log --- .../index_patterns/index_patterns.ts | 32 +++++-------------- .../index_patterns_api_client.ts | 5 +++ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index dfd37262bdee..4692876c1e04 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -209,10 +209,6 @@ export class IndexPatternsService { return !hasFieldCaps || !hasDocValuesFlag; }); - if (isFieldRefreshRequired) { - // eslint-disable-next-line no-console - console.log('isFieldRefreshRequired == true for specs', JSON.stringify(specs)); - } return isFieldRefreshRequired; } @@ -253,8 +249,6 @@ export class IndexPatternsService { refreshFields = async (indexPattern: IndexPattern) => { try { const fields = await this.getFieldsForIndexPattern(indexPattern); - // eslint-disable-next-line no-console - console.log('refreshFields returns', JSON.stringify(fields)); const scripted = indexPattern.getScriptedFields().map((field) => field.spec); indexPattern.fields.replaceAll([...fields, ...scripted]); } catch (err) { @@ -292,18 +286,20 @@ export class IndexPatternsService { return this.fieldArrayToMap([...newFields, ...scriptdFields]); } catch (err) { // eslint-disable-next-line no-console - console.log('refreshFieldSpecMap ERROR', JSON.stringify(err)); + console.log('refreshFieldSpecMap ERROR'); if (err instanceof IndexPatternMissingIndices) { this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); return {}; } + const msg = i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { + defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', + values: { id, title }, + }); this.onError(err, { - title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { - defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', - values: { id, title }, - }), + title: msg, }); + throw new Error(msg); } return fields; }; @@ -392,15 +388,9 @@ export class IndexPatternsService { params: typeMeta && typeMeta.params, }) : spec.fields; - if (isFieldRefreshRequired) { - // eslint-disable-next-line no-console - console.log('fields fetched', JSON.stringify(spec.fields)); - } } catch (err) { isSaveRequired = false; if (err instanceof IndexPatternMissingIndices) { - // eslint-disable-next-line no-console - console.error('index pattern missing', JSON.stringify(err)); this.onNotification({ title: (err as any).message, color: 'danger', @@ -408,7 +398,7 @@ export class IndexPatternsService { }); } else { // eslint-disable-next-line no-console - console.error('fields fetching not possible', JSON.stringify(err)); + console.error('fields fetching not possible'); this.onError(err, { title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', @@ -426,8 +416,6 @@ export class IndexPatternsService { indexPatternCache.set(id, indexPattern); if (isSaveRequired) { try { - // eslint-disable-next-line no-console - console.error('updateSavedObject starts', JSON.stringify(spec.fields)); this.updateSavedObject(indexPattern); } catch (err) { this.onError(err, { @@ -442,10 +430,6 @@ export class IndexPatternsService { }); } } - if (isFieldRefreshRequired) { - // eslint-disable-next-line no-console - console.error('resetOriginalSavedObjectBode', JSON.stringify(spec.fields)); - } indexPattern.resetOriginalSavedObjectBody(); return indexPattern; }; diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts index d36c07a42551..ab7aa75819cb 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts @@ -36,6 +36,11 @@ export class IndexPatternsApiClient implements IIndexPatternsApiClient { query, }) .catch((resp: any) => { + // eslint-disable-next-line no-console + console.error('IndexPatternsApiClient ERROR'); + // eslint-disable-next-line no-console + console.error('IndexPatternsApiClient ERROR DEBUG', JSON.stringify(resp)); + if (resp.body.statusCode === 404 && resp.body.attributes?.code === 'no_matching_indices') { throw new IndexPatternMissingIndices(resp.body.message); } From 3b8b56467d8f6453aeb14d69f3d41b3808b0d17a Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Mon, 30 Nov 2020 08:41:44 +0100 Subject: [PATCH 10/10] Improve code --- .../index_patterns/index_patterns.ts | 20 +++++++------------ .../index_patterns_api_client.ts | 5 ----- test/functional/apps/discover/_date_nanos.js | 2 -- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts index 82e07bbb72f9..e09246ae8cd3 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_patterns.ts @@ -203,13 +203,12 @@ export class IndexPatternsService { */ getFieldsForWildcard = async (options: GetFieldsOptions) => { const metaFields = await this.config.get(UI_SETTINGS.META_FIELDS); - const result = this.apiClient.getFieldsForWildcard({ + return this.apiClient.getFieldsForWildcard({ pattern: options.pattern, metaFields, type: options.type, rollupIndex: options.rollupIndex, }); - return result; }; /** @@ -268,22 +267,21 @@ export class IndexPatternsService { options: GetFieldsOptions, fieldAttrs: FieldAttrs = {} ) => { - // eslint-disable-next-line no-console - console.log('refreshFieldSpecMap start'); const scriptdFields = Object.values(fields).filter((field) => field.scripted); try { const newFields = (await this.getFieldsForWildcard(options)) as FieldSpec[]; return this.fieldArrayToMap([...newFields, ...scriptdFields], fieldAttrs); } catch (err) { - // eslint-disable-next-line no-console - console.log('refreshFieldSpecMap ERROR'); if (err instanceof IndexPatternMissingIndices) { this.onNotification({ title: (err as any).message, color: 'danger', iconType: 'alert' }); return {}; } - const msg = i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { - defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', - values: { id, title }, + + this.onError(err, { + title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { + defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', + values: { id, title }, + }), }); throw err; } @@ -383,8 +381,6 @@ export class IndexPatternsService { iconType: 'alert', }); } else { - // eslint-disable-next-line no-console - console.error('fields fetching not possible'); this.onError(err, { title: i18n.translate('data.indexPatterns.fetchFieldErrorTitle', { defaultMessage: 'Error fetching fields for index pattern {title} (ID: {id})', @@ -512,8 +508,6 @@ export class IndexPatternsService { .then((resp) => { indexPattern.id = resp.id; indexPattern.version = resp.version; - // eslint-disable-next-line no-console - console.error('index pattern saved successfully'); }) .catch(async (err) => { if (err?.res?.status === 409 && saveAttempts++ < MAX_ATTEMPTS_TO_RESOLVE_CONFLICTS) { diff --git a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts index 91ff60fa2f81..ca0f35d6612b 100644 --- a/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts +++ b/src/plugins/data/public/index_patterns/index_patterns/index_patterns_api_client.ts @@ -40,11 +40,6 @@ export class IndexPatternsApiClient implements IIndexPatternsApiClient { query, }) .catch((resp: any) => { - // eslint-disable-next-line no-console - console.error('IndexPatternsApiClient ERROR'); - // eslint-disable-next-line no-console - console.error('IndexPatternsApiClient ERROR DEBUG', JSON.stringify(resp)); - if (resp.body.statusCode === 404 && resp.body.attributes?.code === 'no_matching_indices') { throw new IndexPatternMissingIndices(resp.body.message); } diff --git a/test/functional/apps/discover/_date_nanos.js b/test/functional/apps/discover/_date_nanos.js index 7e2ef604f4b1..1b5c033d67a4 100644 --- a/test/functional/apps/discover/_date_nanos.js +++ b/test/functional/apps/discover/_date_nanos.js @@ -27,8 +27,6 @@ export default function ({ getService, getPageObjects }) { const fromTime = 'Sep 22, 2019 @ 20:31:44.000'; const toTime = 'Sep 23, 2019 @ 03:31:44.000'; - // Failing: See https://github.com/elastic/kibana/issues/82035 - describe('date_nanos', function () { before(async function () { await esArchiver.loadIfNeeded('date_nanos');