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

Failing test: X-Pack EPM API Integration Tests.x-pack/test/fleet_api_integration/apis/epm/list·ts - EPM Endpoints EPM - list list api tests lists all limited packages from the registry #167188

Closed
kibanamachine opened this issue Sep 25, 2023 · 20 comments · Fixed by #170305 or #174679
Assignees
Labels
failed-test A test failure on a tracked branch, potentially flaky-test Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@kibanamachine
Copy link
Contributor

kibanamachine commented Sep 25, 2023

A test failed on a tracked branch

Error: expected [] to sort of equal [ 'endpoint' ]
    at Assertion.assert (expect.js:100:11)
    at Assertion.eql (expect.js:244:8)
    at Context.<anonymous> (list.ts:58:46)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.apply (wrap_function.js:73:16) {
  actual: '[]',
  expected: '[\n  "endpoint"\n]',
  showDiff: true
}

First failure: CI Build - main

@kibanamachine kibanamachine added the failed-test A test failure on a tracked branch, potentially flaky-test label Sep 25, 2023
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 25, 2023
@kibanamachine kibanamachine added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 25, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Sep 25, 2023
@jlind23
Copy link
Contributor

jlind23 commented Sep 26, 2023

@kpollich I might be wrong but isn't this an Endpoint related test?

@kpollich
Copy link
Member

I don't think this is actually related to endpoint, but the assertion is expecting the endpoint package to be installed.

it('lists all limited packages from the registry', async function () {
const fetchLimitedPackageList = async () => {
const response = await supertest
.get('/api/fleet/epm/packages/limited')
.set('kbn-xsrf', 'xxx')
.expect(200);
return response.body;
};
const listResponse = await fetchLimitedPackageList();
expect(listResponse.items.sort()).to.eql(['endpoint'].sort());
});

@juliaElastic
Copy link
Contributor

juliaElastic commented Sep 26, 2023

I'm seeing this error in the logs (happening in a 8.10 pr too):

[00:00:15]         │ proc [kibana] [2023-09-26T13:55:10.808+00:00][WARN ][plugins.fleet] Failure to install package [endpoint]: [ResponseError: resource_not_found_exception
[00:00:15]         │ proc [kibana] 	Root causes:
[00:00:15]         │ proc [kibana] 		resource_not_found_exception: Transform with id [endpoint.metadata_united-default-8.10.2] could not be found]
[00:00:15]         │ proc [kibana] [2023-09-26T13:55:10.809+00:00][ERROR][plugins.fleet] uninstalling endpoint-8.10.2 after error installing: [ResponseError: resource_not_found_exception
[00:00:15]         │ proc [kibana] 	Root causes:
[00:00:15]         │ proc [kibana] 		resource_not_found_exception: Transform with id [endpoint.metadata_united-default-8.10.2] could not be found]
[00:00:15]         │ proc [kibana] [2023-09-26T13:55:10.852+00:00][DEBUG][plugins.fleet] Created transform: endpoint.metadata_current-default-8.10.2

Seems flaky though, can't reproduce locally.

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@jbudz
Copy link
Member

jbudz commented Sep 27, 2023

/skip

@kibanamachine
Copy link
Contributor Author

Skipped

main: e70181a

@juliaElastic juliaElastic self-assigned this Nov 1, 2023
juliaElastic added a commit that referenced this issue Nov 1, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Nov 1, 2023
kibanamachine referenced this issue Nov 1, 2023
# Backport

This will backport the following commits from `main` to `8.11`:
- [[Fleet] enable flaky tests
(#170305)](#170305)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-11-01T12:55:54Z","message":"[Fleet]
enable flaky tests (#170305)\n\nCloses
https://github.com/elastic/kibana/issues/167188\r\nCloses
https://github.com/elastic/kibana/issues/156941","sha":"10f7865e4559b43f49d3a73dfd469dee34631938","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.12.0","v8.11.1"],"number":170305,"url":"https://github.com/elastic/kibana/pull/170305","mergeCommit":{"message":"[Fleet]
enable flaky tests (#170305)\n\nCloses
https://github.com/elastic/kibana/issues/167188\r\nCloses
https://github.com/elastic/kibana/issues/156941","sha":"10f7865e4559b43f49d3a73dfd469dee34631938"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170305","number":170305,"mergeCommit":{"message":"[Fleet]
enable flaky tests (#170305)\n\nCloses
https://github.com/elastic/kibana/issues/167188\r\nCloses
https://github.com/elastic/kibana/issues/156941","sha":"10f7865e4559b43f49d3a73dfd469dee34631938"}},{"branch":"8.11","label":"v8.11.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
@kibanamachine kibanamachine reopened this Nov 1, 2023
@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - main

delanni pushed a commit to delanni/kibana that referenced this issue Nov 6, 2023
mistic added a commit that referenced this issue Nov 7, 2023
@mistic
Copy link
Member

mistic commented Nov 7, 2023

Skipped.

main: df569d0
8.11: 886ac2c

@kpollich
Copy link
Member

kpollich commented Nov 7, 2023

Tests don't seem to find the bundled packages here, not sure if it's relevant:

proc [kibana] [2023-11-05T05:36:37.859+00:00][WARN ][plugins.fleet] Bundled package directory /tmp/fleet_bundled_packages does not exist. All packages will be sourced from http://localhost:6104. {"service":{"node":{"roles":["background_tasks","ui"]}}}

The failure in question is expecting endpoint to be installed, but it isn't



1)    EPM Endpoints
--
  | EPM - list
  | list api tests
  | lists all limited packages from the registry:
  |  
  |  
  | Error: expected [] to sort of equal [ 'endpoint' ]
  | + expected - actual
  |  
  | -[]
  | +[
  | +  "endpoint"
  | +]


@kibanamachine
Copy link
Contributor Author

New failure: CI Build - 8.11

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - 8.11

@kibanamachine
Copy link
Contributor Author

New failure: CI Build - 8.11

@juliaElastic
Copy link
Contributor

juliaElastic commented Jan 11, 2024

Tests don't seem to find the bundled packages here, not sure if it's relevant

@kpollich It is relevant, as the test fails on endpoint not being in registry, similar to this one: #163203 (comment)

Found that the bundled packages are downloaded in ci build, but not in the expected /tmp/fleet_bundled_packages folder, maybe this changed in ci some time back:
https://buildkite.com/elastic/kibana-pull-request/builds/186974#018cf878-6ed6-45b1-b553-31a5a0c51071


│ info Fetching fleet packages from package registry
--
...
  | │ debg Downloaded 1616079 bytes to /dev/shm/builds/kb-n2-16-spot-aa7d3da422b2f059/elastic/kibana-pull-request/kibana/build/kibana/x-pack/plugins/fleet/target/bundled_packages/endpoint-8.11.1.zip
  | │ debg Downloaded https://epr.elastic.co/epr/endpoint/endpoint-8.11.1.zip
 ...
  | │ info Copied @kbn/fleet-plugin into build


@kpollich
Copy link
Member

Interesting. The closest thing I found to the introduction of the /tmp path is this PR: #126915, but I don't see where we ever would've told this script to download to /tmp. Yet it was definitely working at some point 🤔

@juliaElastic
Copy link
Contributor

Interesting. The closest thing I found to the introduction of the /tmp path is this PR: #126915, but I don't see where we ever would've told this script to download to /tmp. Yet it was definitely working at some point 🤔

Thanks for the link!
From what I understand, we never downloaded the bundled packages to the /tmp folder, but used the code here to copy from fixtures to the tmp folder to test a bundled package (nginx). So the other tests always tried to download the endpoint package from the registry I guess, and sometimes don't find it. I'll try to fix this to add the endpoint package to the bundled fixtures, as it is supposed to be a bundled package.

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 Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
7 participants