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

[test-failed]: Chrome X-Pack UI Functional Tests1.x-pack/test/functional/apps/discover/feature_controls/discover_spaces·ts - discover feature controls spaces space with index pattern management disabled Navigates to Kibana home rather than index pattern management when no index patterns exist #68849

Closed
liza-mae opened this issue Jun 11, 2020 · 26 comments · Fixed by #68990 or #74073
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure test-cloud

Comments

@liza-mae
Copy link
Contributor

Version: 7.8.0
Class: Chrome X-Pack UI Functional Tests1.x-pack/test/functional/apps/discover/feature_controls/discover_spaces·ts
Stack Trace:
Error: expected testSubject(homeApp) to exist
at TestSubjects.existOrFail (/var/lib/jenkins/workspace/elastic+estf-cloud-kibana-tests/JOB/xpackGrp2/TASK/saas_run_kibana_tests/node/linux-immutable/ci/cloud/common/build/kibana/test/functional/services/common/test_subjects.ts:62:15)
Platform: cloud
Build Num: 324

@liza-mae liza-mae added failed-test A test failure on a tracked branch, potentially flaky-test test-cloud labels Jun 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-test-triage (failed-test)

@liza-mae liza-mae added the Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! label Jun 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

@legrego
Copy link
Member

legrego commented Jun 11, 2020

Reassigning to KibanaApp team since they own the Discover app

@legrego legrego added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! labels Jun 11, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@kertal kertal added the Feature:Discover Discover Application label Jun 12, 2020
@kertal
Copy link
Member

kertal commented Jun 12, 2020

@liza-mae this is strange, the test should navigate to home, since there should be no index patterns available. but there are, and when I checked screens of different failures, they were named: log-*, metrics-*, events-*. Those are not part of the spaces testdata, looking at the Kibana Src, I can find indices in api_integration tests

names: ['log-*', 'metrics-*', 'events-*', '*'],

maybe there's a weird overlapping here?

@liza-mae
Copy link
Contributor Author

liza-mae commented Jul 7, 2020

This issue is still failing on 7.8, I see it was backported: #69132 ?

@liza-mae liza-mae reopened this Jul 7, 2020
@kertal kertal self-assigned this Jul 15, 2020
@kertal
Copy link
Member

kertal commented Jul 29, 2020

@liza-mae this is strange, the test should navigate to home, since there should be no index patterns available. but there are, and when I checked screens of different failures, they were named: log-*, metrics-*, events-*. Those are not part of the spaces testdata, looking at the Kibana Src, I can find indices in api_integration tests

names: ['log-*', 'metrics-*', 'events-*', '*'],

maybe there's a weird overlapping here?

dear @elastic/ingest-management, there seems to be weird problem, only happening in Jenkins cloud test. in a custom space that should be empty, there are log-*, metrics-*, events-* index pattern available. those seem to be part of your API integration test, so my question is, where in those tests are index patterns created? how could they insert index pattern in a custom space? My initial improvement renaming a space to another ID didn't work.

@ruflin
Copy link
Contributor

ruflin commented Jul 29, 2020

@neptunian @skh Could you comment on the above?

@skh
Copy link
Contributor

skh commented Jul 30, 2020

My first guess would be: these index patterns are generated whenever a package is installed. In 7.8, this happens, if ingest manager is enabled, at the point in time when the UI part of the plugin is first loaded, e.g. triggered by a user, or a browser test, logging in to the home page.

Could this apply to one of your tests?
How is the space created? Does the first login goes immediately into the space?

@kertal
Copy link
Member

kertal commented Jul 30, 2020

So the test that's failing creates a space via spacesService, index patterns are disabled for this space

await spacesService.create({
id: 'custom_space_no_index_patterns',
name: 'custom_space_no_index_patterns',
disabledFeatures: ['indexPatterns'],
});

Then it navigates to Discover and it's expecting that there are no index patterns available.

await PageObjects.common.navigateToUrl('discover', '', {

So if ingest manager is enabled, those index patterns are created automatically for this space?

@skh
Copy link
Contributor

skh commented Jul 30, 2020

So if ingest manager is enabled, those index patterns are created automatically for this space?

That's my current theory at least. Can you disable ingest manager in your tests?

@kertal
Copy link
Member

kertal commented Jul 30, 2020

How can I disable the ingest manager or check if it is enabled? shouldn't the creation of those index patterns be excluded for spaces with disabled indexPatterns feature?

@skh
Copy link
Contributor

skh commented Jul 30, 2020

shouldn't the creation of those index patterns be excluded for spaces with disabled indexPatterns feature?

I would have thought so, but maybe it isn't?

Ingest Manager can be disabled by setting xpack.ingestManager.enabled: false. It should be disabled by default in 7.8, but I don't know how the cloud tests are set up.

@skh
Copy link
Contributor

skh commented Jul 30, 2020

I tested this locally on 7.8:

  • start kibana with xpack.ingestManager.enabled: false, set up a space (so that the ingest manager setup is not run in the default space when I log in to create the space in the first place)
  • disable the "index pattern management" feature for this space -- I am not sure what exactly this means, but it looks to me as if it would only hide the index pattern management UI from the user, not completely forbid their existence
  • I did not try to disable access to index patterns through role-based access control
  • restart Kibana with xpack.ingestManager.enabled: true and navigate directly to the discover path
  • observe a call to http://localhost:5601/api/ingest_manager/setup in the browser dev console
  • index patterns logs-*, metrics-* and events-* are indeed created in the space, and the Discover page is shown (instead of the expected redirect to Home)
  • in the Default space these index patterns are not created, and future calls to /api/ingest_manager/setup do not create them (this is irrelevant to your test failure, but I believe it's a bug for us (Cc: @ruflin ))

How can we best proceed to fix your tests?

I think the behavior is wrong, our /setup API endpoint should not set anything up when we're running in a space, because the Ingest Management feature is not meant to be space aware. Thanks for spotting this!

@kertal
Copy link
Member

kertal commented Jul 30, 2020

Thx for testing and all the context. Could you test if the index pattern would be created if you disable the ingestManager for the new space? many thx! if they were not created, this would be the solution for the test.

@skh
Copy link
Contributor

skh commented Jul 30, 2020

I'm afraid Ingest Management can't be disabled per space:

image

@kertal
Copy link
Member

kertal commented Jul 30, 2020

in my 7.9 cloud instance this seems to be possible?
Bildschirmfoto 2020-07-30 um 14 24 32

@kertal
Copy link
Member

kertal commented Jul 30, 2020

The feature is hidden in the UI, but is not disabled.

well, that won't solve the problem

@skh
Copy link
Contributor

skh commented Jul 30, 2020

Ah, you're right, of course it can only be disabled in a space when it is enabled overall with xpack.ingestManager.enabled: true.

When I disable it in the space, the call to /setup still happens. The menu entry is hidden, but the plugin is still being loaded.

@kertal
Copy link
Member

kertal commented Jul 30, 2020

@liza-mae Can't think of a clean solution for this in cloud currently, so I think the test should be disabled for cloud env, linked to an issue, and unskipped when ingestManager no longer inserts index pattern in custom spaces

@kertal
Copy link
Member

kertal commented Aug 3, 2020

@skh I've created a PR (#74073) to skip this test, will you create an issue for index pattern management that I could link, or should I? thx!

@skh
Copy link
Contributor

skh commented Aug 3, 2020

will you create an issue for index pattern management that I could link, or should I? thx!

I will create an issue for ingest management. Does this need a fix for 7.8?

@kertal
Copy link
Member

kertal commented Aug 3, 2020

will you create an issue for index pattern management that I could link, or should I? thx!

I will create an issue for ingest management. Does this need a fix for 7.8?

thx! don't think it's necessary for 7.8

@kertal
Copy link
Member

kertal commented Aug 5, 2020

dear @skh #68849 would be ready for merge, but it would be nice to add a link to an issue, when the skipped test can be unskipped again (couldn't find one)

@skh
Copy link
Contributor

skh commented Aug 5, 2020

@kertal Apologies for the delay: #74353

@kertal
Copy link
Member

kertal commented Aug 5, 2020

@skh no problem, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure test-cloud
Projects
None yet
6 participants