Skip to content

Fix ESRestTestCase.clusterHasCapability to work in bwc / mixed cluster tests#108889

Merged
mosche merged 2 commits intoelastic:mainfrom
mosche:fix_ESRestTestCase_clusterHasCapability
May 22, 2024
Merged

Fix ESRestTestCase.clusterHasCapability to work in bwc / mixed cluster tests#108889
mosche merged 2 commits intoelastic:mainfrom
mosche:fix_ESRestTestCase_clusterHasCapability

Conversation

@mosche
Copy link
Copy Markdown
Contributor

@mosche mosche commented May 22, 2024

Fix ESRestTestCase.clusterHasCapability to work in bwc / mixed cluster tests when capabilities API is unsupported.

@mosche mosche added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label labels May 22, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@mosche mosche added the Team:Core/Infra Meta label for core/infra team label May 22, 2024
@mosche mosche requested a review from a team May 22, 2024 09:45
return Optional.ofNullable((Boolean) response.get("supported"));
try {
Map<String, Object> response = entityAsMap(client.performRequest(request).getEntity());
return Optional.ofNullable((Boolean) response.get("supported"));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm if we get null here that means that some node failed to respond. That seems like it should be a test failure? I.e. can we assert that this isn't null?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wondering, @thecoop, wouldn't it be more consistent if the API returned a server error in this case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll keep this as is for now. We're going to discuss this independently as a follow up item.

@mosche mosche merged commit 494883d into elastic:main May 22, 2024
@mosche mosche deleted the fix_ESRestTestCase_clusterHasCapability branch May 22, 2024 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.15.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants