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

Fix Rest Tests Failing to Cleanup Rollup Jobs #51246

Merged
merged 4 commits into from
Jan 22, 2020

Conversation

original-brownbear
Copy link
Member

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes #50819

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes elastic#50819
@original-brownbear original-brownbear added >test Issues or PRs that are addressing/adding tests :Delivery/Build Build or test infrastructure v8.0.0 v7.6.0 v7.7.0 labels Jan 21, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

Lgtm. I just ask for a comment.

} catch (ResponseException e) {
if (e.getResponse().getStatusLine().getStatusCode() == RestStatus.NOT_FOUND.getStatus()) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

I think it is worth adding a comment here explaining why this is ok.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM also

@original-brownbear
Copy link
Member Author

Jenkins run
elasticsearch-ci/1

@original-brownbear
Copy link
Member Author

Jenkins run elasticsearch-ci/1 (unrelated failure)

@original-brownbear
Copy link
Member Author

Thanks Nik + Lee!

@original-brownbear original-brownbear merged commit 6da66c6 into elastic:master Jan 22, 2020
@original-brownbear original-brownbear deleted the fix-bwc-50819 branch January 22, 2020 09:40
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jan 22, 2020
* Fix Rest Tests Failing to Cleanup Rollup Jobs

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes elastic#50819
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jan 22, 2020
* Fix Rest Tests Failing to Cleanup Rollup Jobs

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes elastic#50819
original-brownbear added a commit that referenced this pull request Jan 22, 2020
* Fix Rest Tests Failing to Cleanup Rollup Jobs

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes #50819
original-brownbear added a commit that referenced this pull request Jan 22, 2020
* Fix Rest Tests Failing to Cleanup Rollup Jobs

If the rollup jobs index doesn't exist for some reason (like running against a 6.x cluster)
we should just assume the jobs have been cleaned up and move on.

Closes #50819
@polyfractal
Copy link
Contributor

Heya everyone :) Found this PRwhile investigating: #51141

I'm not sure this is the correct approach? E.g. if that endpoint is failing, it means we're talking to 6.x and need to use the deprecated URLs instead? Note that /_rollup/job/_all is an API endpoint, not an index. We need to fall back to /_xpack/rollup/job/_all for older clusters

When this was fixed in the FullClusterRestart tests, we checked if it was running against the old cluster and changed URL accordingly.

I don't think there is similar ability in ESRestTestCase so I'm not sure the best course of action, but I'm worried that just ignoring cleanup won't work because other tests may run into an existing job that should have been cleaned, but wasn't because the wipeRollupJob() method bailed early?

@original-brownbear
Copy link
Member Author

Urgh, sorry about that @polyfractal!

We could use a construct like

        if (nodeVersions.stream().allMatch(version -> version.onOrAfter(Version.V_7_6_0))) {

in the rest tests and change the URL according to the ES version we're dealing with right?

@polyfractal
Copy link
Contributor

No worries! I'm only vaguely aware of how all these BWC tests work/interact so wasnt sure myself either how to deal with it :)

That sounds like it would work to me! Do the ESRestTestCases fail if a deprecation warning is thrown? E.g. if we switch to using the old endpoint because one of the nodes is still 6.x, but talk to a 7.x node, it will throw a deprecation warning. I remember elsewhere it causing problems because the deprecation failed the test... not sure if that would happen here though

@original-brownbear original-brownbear restored the fix-bwc-50819 branch August 6, 2020 18:23
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests v7.6.0 v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BWC test failures for MultiVersionRepositoryAccessIT
7 participants