Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed usage of isReady for usage collection of alerts and actions #83760

Merged

Conversation

YulNaumenko
Copy link
Contributor

Current PR includes the changes which make the requirement for actions and alerts collectors to set isReady as true only when the TaskManager plugin will be ready.
Changed alerts plugin setup method to be a synchronous.

Resolve #82947

@YulNaumenko YulNaumenko added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Actions Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 labels Nov 19, 2020
@YulNaumenko YulNaumenko requested a review from a team as a code owner November 19, 2020 03:34
@YulNaumenko YulNaumenko self-assigned this Nov 19, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a few notes about RX usage and inlining the isReady to avoid an intermediary variable.
I'll try and validate my theory about the task potentially stalling, but in either case, we don't want the task to wait on a fresh config every time, so that should be addressed.

x-pack/plugins/actions/server/plugin.ts Outdated Show resolved Hide resolved
x-pack/plugins/actions/server/plugin.ts Outdated Show resolved Hide resolved
x-pack/plugins/actions/server/usage/task.ts Outdated Show resolved Hide resolved
x-pack/plugins/alerts/server/plugin.ts Outdated Show resolved Hide resolved
@YulNaumenko YulNaumenko requested a review from gmmorris November 19, 2020 21:49
Copy link
Contributor

@gmmorris gmmorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/drilldowns/dashboard_to_url_drilldown·ts.dashboard drilldowns Dashboard to URL drilldown should create dashboard to URL drilldown and use it to navigate to discover

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 2 times on tracked branches: https://github.com/elastic/kibana/issues/83875

[00:00:00]       │
[00:00:00]         └-: dashboard
[00:00:00]           └-> "before all" hook
[00:10:56]           └-: drilldowns
[00:10:56]             └-> "before all" hook
[00:10:56]             └-> "before all" hook
[00:10:56]               │ info [logstash_functional] Loading "mappings.json"
[00:10:56]               │ info [logstash_functional] Loading "data.json.gz"
[00:10:56]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.22"
[00:10:56]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.20"
[00:10:56]               │ info [logstash_functional] Skipped restore for existing index "logstash-2015.09.21"
[00:10:57]               │ info [dashboard/drilldowns] Loading "mappings.json"
[00:10:57]               │ info [dashboard/drilldowns] Loading "data.json"
[00:10:57]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_1/8E4269L2TpiUPZkqb0opGw] deleting index
[00:10:57]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2/2h2-N6vyThmMY-WHuLHIiQ] deleting index
[00:10:57]               │ info [dashboard/drilldowns] Deleted existing index [".kibana_2",".kibana_1"]
[00:10:57]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana] creating index, cause [api], templates [], shards [1]/[1]
[00:10:57]               │ info [dashboard/drilldowns] Created index ".kibana"
[00:10:57]               │ debg [dashboard/drilldowns] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:10:57]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana/x656vhKkS3myfzETuCO4IQ] update_mapping [_doc]
[00:10:57]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana/x656vhKkS3myfzETuCO4IQ] update_mapping [_doc]
[00:10:57]               │ info [dashboard/drilldowns] Indexed 12 docs into ".kibana"
[00:10:57]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana/x656vhKkS3myfzETuCO4IQ] update_mapping [_doc]
[00:10:57]               │ debg Migrating saved objects
[00:10:57]               │ proc [kibana]   log   [02:13:12.951] [info][savedobjects-service] Creating index .kibana_2.
[00:10:57]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1]
[00:10:57]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] updating number_of_replicas to [0] for indices [.kibana_2]
[00:10:57]               │ proc [kibana]   log   [02:13:13.018] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:10:57]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1]
[00:10:57]               │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] updating number_of_replicas to [0] for indices [.kibana_1]
[00:10:57]               │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] 15400 finished with response BulkByScrollResponse[took=20.1ms,timed_out=false,sliceId=null,updated=0,created=12,deleted=0,batches=1,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:10:57]               │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana/x656vhKkS3myfzETuCO4IQ] deleting index
[00:10:57]               │ proc [kibana]   log   [02:13:13.369] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:10:57]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2/Tn72NGVnTue7DedxZgrNRA] update_mapping [_doc]
[00:10:57]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2/Tn72NGVnTue7DedxZgrNRA] update_mapping [_doc]
[00:10:57]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2/Tn72NGVnTue7DedxZgrNRA] update_mapping [_doc]
[00:10:58]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2/Tn72NGVnTue7DedxZgrNRA] update_mapping [_doc]
[00:10:58]               │ proc [kibana]   log   [02:13:13.605] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:10:58]               │ proc [kibana]   log   [02:13:13.648] [info][savedobjects-service] Finished in 698ms.
[00:10:58]               │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:10:58]               │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-debian-tests-xxl-1605922296857121636] [.kibana_2/Tn72NGVnTue7DedxZgrNRA] update_mapping [_doc]
[00:10:59]               │ debg replacing kibana config doc: {"defaultIndex":"logstash-*"}
[00:13:01]             └-: Dashboard to URL drilldown
[00:13:01]               └-> "before all" hook
[00:13:01]               └-> "before all" hook
[00:13:01]                 │ debg Dashboard to URL:initTests
[00:13:01]                 │ debg navigating to dashboard url: http://localhost:6191/app/dashboards#/list
[00:13:01]                 │ debg navigate to: http://localhost:6191/app/dashboards#/list
[00:13:02]                 │ debg browser[INFO] http://localhost:6191/app/dashboards?_t=1605924917371#/list 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:13:02]                 │
[00:13:02]                 │ debg browser[INFO] http://localhost:6191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:13:02]                 │ debg ... sleep(700) start
[00:13:02]                 │ debg ... sleep(700) end
[00:13:02]                 │ debg returned from get, calling refresh
[00:13:02]                 │ debg browser[INFO] http://localhost:6191/app/dashboards?_t=1605924917371#/list 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:13:02]                 │
[00:13:02]                 │ debg browser[INFO] http://localhost:6191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:13:02]                 │ debg currentUrl = http://localhost:6191/app/dashboards#/list
[00:13:02]                 │          appUrl = http://localhost:6191/app/dashboards#/list
[00:13:02]                 │ debg TestSubjects.find(kibanaChrome)
[00:13:02]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:13:04]                 │ debg ... sleep(501) start
[00:13:04]                 │ debg ... sleep(501) end
[00:13:04]                 │ debg in navigateTo url = http://localhost:6191/app/dashboards#/list?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:13:04]                 │ debg --- retry.try error: URL changed, waiting for it to settle
[00:13:05]                 │ debg ... sleep(501) start
[00:13:05]                 │ debg ... sleep(501) end
[00:13:05]                 │ debg in navigateTo url = http://localhost:6191/app/dashboards#/list?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:13:05]                 │ debg TestSubjects.exists(statusPageContainer)
[00:13:05]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:13:08]                 │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:13:08]                 │ debg isGlobalLoadingIndicatorVisible
[00:13:08]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:08]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:08]                 │ debg browser[INFO] http://localhost:6191/app/dashboards#/list?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now)) 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:13:08]                 │
[00:13:08]                 │ debg browser[INFO] http://localhost:6191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:13:10]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:10]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:10]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:11]               └-> should create dashboard to URL drilldown and use it to navigate to discover
[00:13:11]                 └-> "before each" hook: global before each
[00:13:11]                 │ debg Load Saved Dashboard Dashboard With Area Chart
[00:13:11]                 │ debg gotoDashboardLandingPage
[00:13:11]                 │ debg onDashboardLandingPage
[00:13:11]                 │ debg TestSubjects.exists(dashboardLandingPage)
[00:13:11]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=5000
[00:13:11]                 │ debg searchForItemWithName: Dashboard With Area Chart
[00:13:11]                 │ debg TestSubjects.find(tableListSearchBox)
[00:13:11]                 │ debg Find.findByCssSelector('[data-test-subj="tableListSearchBox"]') with timeout=10000
[00:13:11]                 │ debg isGlobalLoadingIndicatorVisible
[00:13:11]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:11]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:12]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:13]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:13]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:13]                 │ debg TestSubjects.click(dashboardListingTitleLink-Dashboard-With-Area-Chart)
[00:13:13]                 │ debg Find.clickByCssSelector('[data-test-subj="dashboardListingTitleLink-Dashboard-With-Area-Chart"]') with timeout=10000
[00:13:13]                 │ debg Find.findByCssSelector('[data-test-subj="dashboardListingTitleLink-Dashboard-With-Area-Chart"]') with timeout=10000
[00:13:13]                 │ debg isGlobalLoadingIndicatorVisible
[00:13:13]                 │ debg TestSubjects.exists(globalLoadingIndicator)
[00:13:13]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:13:15]                 │ERROR browser[SEVERE] http://localhost:6191/38238/bundles/plugin/visualizations/visualizations.plugin.js 5:95865 Error: Saved field "@timestamp" of index pattern "logstash-*" is invalid for use with the "Date Histogram" aggregation. Please select a new field.
[00:13:15]                 │          at FieldParamType.deserialize (http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:615592)
[00:13:15]                 │          at http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:404023
[00:13:15]                 │          at Array.forEach (<anonymous>)
[00:13:15]                 │          at AggConfig.setParams (http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:403447)
[00:13:15]                 │          at AggConfig.set type [as type] (http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:409226)
[00:13:15]                 │          at AggConfig.setType (http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:409326)
[00:13:15]                 │          at new AggConfig (http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:403245)
[00:13:15]                 │          at agg_configs_AggConfigs.createAggConfig (http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:185451)
[00:13:15]                 │          at http://localhost:6191/38238/bundles/plugin/data/data.plugin.js:1:185803
[00:13:15]                 │          at Array.forEach (<anonymous>)
[00:13:15]                 │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:13:15]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:13:15]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:13:15]                 │ debg TestSubjects.missingOrFail(dashboardLandingPage)
[00:13:15]                 │ debg Find.waitForDeletedByCssSelector('[data-test-subj="dashboardLandingPage"]') with timeout=10000
[00:13:16]                 │ debg Switching to edit mode
[00:13:16]                 │ debg TestSubjects.click(dashboardEditMode)
[00:13:16]                 │ debg Find.clickByCssSelector('[data-test-subj="dashboardEditMode"]') with timeout=10000
[00:13:16]                 │ debg Find.findByCssSelector('[data-test-subj="dashboardEditMode"]') with timeout=10000
[00:13:16]                 │ debg Waiting up to 20000ms for in edit mode...
[00:13:16]                 │ debg TestSubjects.findAll(embeddablePanel)
[00:13:16]                 │ debg Find.allByCssSelector('[data-test-subj="embeddablePanel"]') with timeout=2500
[00:13:16]                 │ debg TestSubjects.findAll(embeddablePanelToggleMenuIcon)
[00:13:16]                 │ debg Find.allByCssSelector('[data-test-subj="embeddablePanelToggleMenuIcon"]') with timeout=2500
[00:13:16]                 │ debg openContextMenu(undefined
[00:13:16]                 │ debg TestSubjects.exists(embeddablePanelContextMenuOpen)
[00:13:16]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="embeddablePanelContextMenuOpen"]') with timeout=2500
[00:13:18]                 │ debg --- retry.tryForTime error: [data-test-subj="embeddablePanelContextMenuOpen"] is not displayed
[00:13:19]                 │ debg toggleContextMenu
[00:13:19]                 │ debg TestSubjects.moveMouseTo(dashboardPanelTitle)
[00:13:19]                 │ debg TestSubjects.find(dashboardPanelTitle)
[00:13:19]                 │ debg Find.findByCssSelector('[data-test-subj="dashboardPanelTitle"]') with timeout=10000
[00:13:19]                 │ debg TestSubjects.find(embeddablePanelToggleMenuIcon)
[00:13:19]                 │ debg Find.findByCssSelector('[data-test-subj="embeddablePanelToggleMenuIcon"]') with timeout=10000
[00:13:19]                 │ debg TestSubjects.exists(embeddablePanelContextMenuOpen)
[00:13:19]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="embeddablePanelContextMenuOpen"]') with timeout=120000
[00:13:19]                 │ debg expectExistsCreateDrilldownAction
[00:13:19]                 │ debg TestSubjects.exists(embeddablePanelAction-OPEN_FLYOUT_ADD_DRILLDOWN)
[00:13:19]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="embeddablePanelAction-OPEN_FLYOUT_ADD_DRILLDOWN"]') with timeout=120000
[00:13:22]                 │ debg --- retry.tryForTime error: [data-test-subj="embeddablePanelAction-OPEN_FLYOUT_ADD_DRILLDOWN"] is not displayed
[00:13:25]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:28]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:31]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:34]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:37]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:40]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:43]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:46]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:49]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:52]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:55]                 │ debg --- retry.tryForTime failed again with the same message...
[00:13:58]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:01]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:04]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:07]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:10]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:13]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:16]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:19]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:22]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:26]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:29]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:32]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:35]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:38]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:41]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:44]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:47]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:50]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:53]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:56]                 │ debg --- retry.tryForTime failed again with the same message...
[00:14:59]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:02]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:05]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:08]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:11]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:14]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:17]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:20]                 │ debg --- retry.tryForTime failed again with the same message...
[00:15:21]                 │ info Taking screenshot "/dev/shm/workspace/parallel/9/kibana/x-pack/test/functional/screenshots/failure/dashboard drilldowns Dashboard to URL drilldown should create dashboard to URL drilldown and use it to navigate to discover.png"
[00:15:21]                 │ info Current URL is: http://localhost:6191/app/dashboards#/view/24f3f950-69d9-11ea-a14d-e341629a29e6?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-19T17:34:10.297Z%27,to:%272015-09-23T00:09:17.180Z%27))&_a=(description:%27%27,filters:!(),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!t),panels:!((embeddableConfig:(enhancements:(dynamicActions:(events:!((action:(config:(dashboardId:%2741e77910-69d9-11ea-a14d-e341629a29e6%27,useCurrentDateRange:!t,useCurrentFilters:!t),factoryId:DASHBOARD_TO_DASHBOARD_DRILLDOWN,name:%27Go%20to%20pie%20chart%20dashboard%27),eventId:ffd3e4dc-cb1a-419f-afeb-03e8c7742bbf,triggers:!(VALUE_CLICK_TRIGGER,SELECT_RANGE_TRIGGER)))))),gridData:(h:15,i:e637d5f0-a7e6-4635-81ed-39f2b1aac6f4,w:24,x:0,y:0),id:Visualization%E6%BC%A2%E5%AD%97-AreaChart,panelIndex:e637d5f0-a7e6-4635-81ed-39f2b1aac6f4,type:visualization,version:%278.0.0-SNAPSHOT%27)),query:(language:kuery,query:%27%27),tags:!(),timeRestore:!t,title:%27Dashboard%20With%20Area%20Chart%27,viewMode:edit)
[00:15:21]                 │ info Saving page source to: /dev/shm/workspace/parallel/9/kibana/x-pack/test/functional/failure_debug/html/dashboard drilldowns Dashboard to URL drilldown should create dashboard to URL drilldown and use it to navigate to discover.html
[00:15:21]                 └- ✖ fail: dashboard drilldowns Dashboard to URL drilldown should create dashboard to URL drilldown and use it to navigate to discover
[00:15:21]                 │      Error: expected testSubject(embeddablePanelAction-OPEN_FLYOUT_ADD_DRILLDOWN) to exist
[00:15:21]                 │       at TestSubjects.existOrFail (/dev/shm/workspace/parallel/9/kibana/test/functional/services/common/test_subjects.ts:62:15)
[00:15:21]                 │       at DashboardDrilldownPanelActions.expectExistsCreateDrilldownAction (test/functional/services/dashboard/panel_drilldown_actions.ts:20:7)
[00:15:21]                 │       at Context.<anonymous> (test/functional/apps/dashboard/drilldowns/dashboard_to_url_drilldown.ts:35:7)
[00:15:21]                 │       at Object.apply (/dev/shm/workspace/parallel/9/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
[00:15:21]                 │ 
[00:15:21]                 │ 

Stack Trace

Error: expected testSubject(embeddablePanelAction-OPEN_FLYOUT_ADD_DRILLDOWN) to exist
    at TestSubjects.existOrFail (/dev/shm/workspace/parallel/9/kibana/test/functional/services/common/test_subjects.ts:62:15)
    at DashboardDrilldownPanelActions.expectExistsCreateDrilldownAction (test/functional/services/dashboard/panel_drilldown_actions.ts:20:7)
    at Context.<anonymous> (test/functional/apps/dashboard/drilldowns/dashboard_to_url_drilldown.ts:35:7)
    at Object.apply (/dev/shm/workspace/parallel/9/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@YulNaumenko YulNaumenko merged commit 3ee6e47 into elastic:master Nov 21, 2020
YulNaumenko added a commit to YulNaumenko/kibana that referenced this pull request Nov 21, 2020
…lastic#83760)

* Fixed usage of `isReady` for usage collection of alerts and actions

* fixed index

* fixed due to comments

* fixed type check

* fixed due to comments
YulNaumenko added a commit that referenced this pull request Nov 21, 2020
…83760) (#84009)

* Fixed usage of `isReady` for usage collection of alerts and actions

* fixed index

* fixed due to comments

* fixed type check

* fixed due to comments
gmmorris added a commit to rudolf/kibana that referenced this pull request Nov 23, 2020
* master: (67 commits)
  [Observability] Load hasData call asynchronously (elastic#80644)
  Implement AnonymousAuthenticationProvider. (elastic#79985)
  Deprecate `visualization:colorMapping` advanced setting (elastic#83372)
  [TSVB] [Rollup] Table tab not working with rollup indexes (elastic#83635)
  Revert "[Search] Search batching using bfetch (elastic#83418)" (elastic#84037)
  skip flaky suite (elastic#83772)
  skip flaky suite (elastic#69849)
  create kbn-legacy-logging package (elastic#77678)
  [Search] Search batching using bfetch (elastic#83418)
  [Security Solution] Refactor Timeline flyout to take a full page (elastic#82033)
  Drop use of console-stamp (elastic#83922)
  skip flaky suite (elastic#84011 , elastic#84012)
  Fixed usage of `isReady` for usage collection of alerts and actions (elastic#83760)
  [maps] support URL drilldowns (elastic#83732)
  Revert "Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (elastic#83226)"
  [code coverage] Update jest config to collect more data (elastic#83804)
  Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (elastic#83226)
  [Security Solution] Give notice when endpoint policy is out of date (elastic#83469)
  [Security Solution] Sync url state on any changes to query string (elastic#83314)
  [CI] Initial TeamCity implementation (elastic#81043)
  ...
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a question whether the this.kibanaIndexConfig.subscribe() will end up calling the subscriber > 1 times.

'actions',
this.createRouteHandlerContext(core, await this.kibanaIndex)
);
this.kibanaIndexConfig.subscribe((config) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that for other uses, we actually only deal with the "first" update of kibanaIndexConfig via kibanaIndexConfig.pipe(first()).toPromise(), but not here.

So it seems like if this.kibanaIndexConfig emits > 1 times per Kibana startup, we'd try to register the routes > 1 times. The same pattern is used in alerts.

Thinking perhaps we should just set kibanaIndexConfig to the following, for consistency, then we can remove the other pipe(first()) usages. Or perhaps I'm missing something.

initContext.config.legacy.globalConfig$.pipe(first())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Actions Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix usage of isReady for usage collection of alerts and actions
5 participants