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

[QA] Switch tests to use importExport - discover #94006

Merged
merged 12 commits into from
Apr 21, 2021

Conversation

wayneseymour
Copy link
Member

@wayneseymour wayneseymour commented Mar 8, 2021

Switch es archiver for kbn archiver everywhere possible

Partially closes #93797

@wayneseymour wayneseymour self-assigned this Mar 8, 2021
@wayneseymour wayneseymour added backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.0.0 labels Mar 8, 2021
@wayneseymour wayneseymour force-pushed the kbnarchiver-switch-discover branch 2 times, most recently from 6bab68e to 5e3c9c4 Compare March 9, 2021 21:35
@wayneseymour
Copy link
Member Author

@elasticmachine merge upstream

@wayneseymour wayneseymour force-pushed the kbnarchiver-switch-discover branch from 789d3f0 to 4de9fc1 Compare March 15, 2021 12:50
@wayneseymour wayneseymour changed the title [QA] Switch discover tests to use kbnarchiver [QA] Switch tests to use kibserver-importExport - discover Mar 15, 2021
@wayneseymour wayneseymour changed the title [QA] Switch tests to use kibserver-importExport - discover [QA] Switch tests to use importExport - discover Mar 15, 2021
@wayneseymour wayneseymour force-pushed the kbnarchiver-switch-discover branch 2 times, most recently from a8d8a4b to b28751a Compare March 18, 2021 16:31
@wayneseymour wayneseymour force-pushed the kbnarchiver-switch-discover branch 2 times, most recently from 282166c to 3d0fad4 Compare March 25, 2021 15:26
@wayneseymour
Copy link
Member Author

@spalger hey sir, Lee and I think we could use your expertise. CI group 6 fails consistently on ci, but never on my local. I wrote a fn that does much the same and it worked. But, we dont wanna use that, we wanna use the kbnarchiver. I'll set it up the way it was and hopefully you can free us of this pestilence! hahaaa

@spalger
Copy link
Contributor

spalger commented Mar 29, 2021

The error I'm seeing in ciGroup6 is because there is no dirFile export in test/functional/utils/import_data.ts, which seems to be the replacement you wrote. Can you point me to the code using kbnArchiver so I can take a look at what's going on?

@wayneseymour
Copy link
Member Author

The error I'm seeing in ciGroup6 is because there is no dirFile export in test/functional/utils/import_data.ts, which seems to be the replacement you wrote. Can you point me to the code using kbnArchiver so I can take a look at what's going on?

yeah totally, I've got another draft pr that has less of my goofs within: #95667

i need it to go through ci once more so you can see that I was talking about though. Running now.

@wayneseymour
Copy link
Member Author

@wayneseymour wayneseymour force-pushed the kbnarchiver-switch-discover branch 5 times, most recently from ba417ba to 5e168ea Compare April 8, 2021 12:27
@wayneseymour
Copy link
Member Author

wayneseymour commented Apr 9, 2021

Since I've to throw an error in lieu of how to use the logger properly, I'm going to record the output of the saved object "types" within the .kibana index here.
Since we've at least three separate calls, so we'll have at least that many ci runs as we can only throw the error once per run.

1st Run BEFORE await esArchiver.load('empty_kibana');

Error: 
[00:00:04]               │      Error: 
[00:00:04]               │ ### SAVED OBJECT TYPES IN index: [.kibana]: 
[00:00:04]               │ [
[00:00:04]               │   {
[00:00:04]               │     doc_count: 1,
[00:00:04]               │     key: 'config'
[00:00:04]               │   }
[00:00:04]               │ ]

2nd Run AFTER await esArchiver.load('empty_kibana'); AND BEFORE await kibanaServer.importExport.load('discover')

[00:00:04]               │      Error: 
[00:00:04]               │ ### SAVED OBJECT TYPES IN index: [.kibana]: 
[00:00:04]               │ [
[00:00:04]               │   {
[00:00:04]               │     doc_count: 2,
[00:00:04]               │     key: 'config'
[00:00:04]               │   }
[00:00:04]               │ ]

3rd Run AFTER await kibanaServer.importExport.load('discover')

Error: 
### SAVED OBJECT TYPES IN index: [.kibana]: 
[
  {
    doc_count: 2,
    key: 'config'
  },
  {
    doc_count: 1,
    key: 'core-usage-stats'
  },
  {
    doc_count: 1,
    key: 'index-pattern'
  },
  {
    doc_count: 1,
    key: 'search'
  }
]

@LeeDr what do you think sir?

@wayneseymour wayneseymour force-pushed the kbnarchiver-switch-discover branch from 36e65e3 to f8b188c Compare April 12, 2021 16:00
@LeeDr
Copy link

LeeDr commented Apr 12, 2021

That output is in the debug logs when a test fails so I don't think you have to force the test to fail at each step. We're adding this logging of the saved objects to help debug why the test was failing in CI. The thought was that a previous test was unloading the .kibana index and that's why the saved object import was failing.

So maybe the calls to log the saved object aggregation could happen in the kibanaServer.importExport.load() method? But I'm not sure if that adds seconds to the call when we're trying to optimize the test execution time?

@LeeDr
Copy link

LeeDr commented Apr 13, 2021

I'm trying to understand the error reason: 'no such index [.kibana_8.0.0] and [require_alias] request flag is [true] and [.kibana_8.0.0] is not an alias',

I think the importExport.load should be loading into .kibana and in that case [require_alias] would be OK. Is it trying to load into .kibana_8.0.0 ?

    before(async function () {
      await kibanaServer.savedObjects.clean({ types: ['search', 'index-pattern'] });
      await kibanaServer.importExport.load('discover');
[00:08:59]               │ proc [kibana]   log   [20:25:08.064] [info][repository][savedobjects-service] savedObjects.bulkCreate success {
[00:08:59]               │ proc [kibana]   saved_objects: [
[00:08:59]               │ proc [kibana]     {
[00:08:59]               │ proc [kibana]       id: 'logstash-*',
[00:08:59]               │ proc [kibana]       type: 'index-pattern',
[00:08:59]               │ proc [kibana]       error: {
[00:08:59]               │ proc [kibana]         statusCode: 500,
[00:08:59]               │ proc [kibana]         error: 'Internal Server Error',
[00:08:59]               │ proc [kibana]         message: 'An internal server error occurred'
[00:08:59]               │ proc [kibana]       },
[00:08:59]               │ proc [kibana]       rawResponse: {
[00:08:59]               │ proc [kibana]         error: {
[00:08:59]               │ proc [kibana]           type: 'index_not_found_exception',
[00:08:59]               │ proc [kibana]           reason: 'no such index [.kibana_8.0.0] and [require_alias] request flag is [true] and [.kibana_8.0.0] is not an alias',
[00:08:59]               │ proc [kibana]           index_uuid: '_na_',
[00:08:59]               │ proc [kibana]           index: '.kibana_8.0.0'
[00:08:59]               │ proc [kibana]         },
[00:08:59]               │ proc [kibana]         _index: '.kibana_8.0.0',
[00:08:59]               │ proc [kibana]         _id: 'index-pattern:logstash-*',
[00:08:59]               │ proc [kibana]         status: 404
[00:08:59]               │ proc [kibana]       }
[00:08:59]               │ proc [kibana]     },

@LeeDr
Copy link

LeeDr commented Apr 13, 2021

Making progress!

From the discover/index file, these passed;

    loadTestFile(require.resolve('./_saved_queries'));
    loadTestFile(require.resolve('./_discover'));
    loadTestFile(require.resolve('./_discover_histogram'));
    loadTestFile(require.resolve('./_doc_table'));
    loadTestFile(require.resolve('./_filter_editor'));
    loadTestFile(require.resolve('./_errors'));
    loadTestFile(require.resolve('./_field_data'));
    loadTestFile(require.resolve('./_field_data_with_fields_api'));
    loadTestFile(require.resolve('./_shared_links'));
    loadTestFile(require.resolve('./_sidebar'));
    loadTestFile(require.resolve('./_source_filters'));
    loadTestFile(require.resolve('./_large_string'));

Failed here on _inspector
    loadTestFile(require.resolve('./_inspector'));
    loadTestFile(require.resolve('./_doc_navigation'));
    loadTestFile(require.resolve('./_date_nanos'));
    loadTestFile(require.resolve('./_date_nanos_mixed'));
    loadTestFile(require.resolve('./_indexpattern_without_timefield'));
    loadTestFile(require.resolve('./_discover_fields_api'));
    loadTestFile(require.resolve('./_data_grid'));
    loadTestFile(require.resolve('./_data_grid_context'));
    loadTestFile(require.resolve('./_data_grid_field_data'));
    loadTestFile(require.resolve('./_data_grid_doc_navigation'));
    loadTestFile(require.resolve('./_data_grid_doc_table'));
    loadTestFile(require.resolve('./_indexpattern_with_unmapped_fields'));
    loadTestFile(require.resolve('./_runtime_fields_editor'));
    loadTestFile(require.resolve('./_huge_fields'));

Remove the kibana index from the hamlet archive,
update the kbn client requester to not xform the axios response,
add a new archive for the large string test, but this time,
use kbn archiver, not es archiver
@wayneseymour wayneseymour marked this pull request as ready for review April 15, 2021 23:51
@wayneseymour wayneseymour requested a review from a team as a code owner April 15, 2021 23:51
@wayneseymour wayneseymour requested a review from spalger April 15, 2021 23:51
await kibanaServer.importExport.load('discover');
log.info(
`\n### SAVED OBJECT TYPES IN index: [.kibana]: \n\t${await savedObjectInfo.types()}`
await esArchiver.load('empty_kibana');
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be in the suite that hasn't been migrated yet, rather than in the suite which has been migrated to use importExport and not replace the .kibana index at runtime.

Copy link
Member Author

Choose a reason for hiding this comment

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

@spalger the suite before this one is skipped bud. Which makes this the first test run. Whatcha think?

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is the first suite run then the .kibana index already exists and is empty and this is unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll strip it and see what happens.

test/functional/apps/discover/_discover.ts Outdated Show resolved Hide resolved
test/functional/apps/discover/_large_string.ts Outdated Show resolved Hide resolved
test/functional/apps/discover/_discover.ts Outdated Show resolved Hide resolved
test/functional/apps/discover/_inspector.ts Outdated Show resolved Hide resolved
@wayneseymour wayneseymour requested review from spalger and LeeDr April 20, 2021 22:37
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

cc @wayneseymour

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

LGTM

@wayneseymour wayneseymour requested a review from dmlemeshko April 21, 2021 16:07
Copy link

@LeeDr LeeDr left a comment

Choose a reason for hiding this comment

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

LGTM - Code reviewed and Jenkins results

@wayneseymour wayneseymour merged commit 1832259 into master Apr 21, 2021
@wayneseymour wayneseymour deleted the kbnarchiver-switch-discover branch April 21, 2021 16:18
@wayneseymour wayneseymour added v7.13.0 v7.14.0 and removed backport:skip This commit does not require backporting labels Apr 21, 2021
wayneseymour added a commit to wayneseymour/kibana that referenced this pull request Apr 21, 2021
Switch es archiver for kbn archiver everywhere possible

Partially closes elastic#93797
wayneseymour added a commit that referenced this pull request Apr 21, 2021
Switch es archiver for kbn archiver everywhere possible

Partially closes #93797
wayneseymour added a commit that referenced this pull request Apr 22, 2021
Switch es archiver for kbn archiver everywhere possible

Partially closes #93797

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QA][Saved Objects][Meta] Use kbn-archiver instead of es-archiver
4 participants