Skip to content

Update the ES creation helper function to teardown it in case of service not available.#18931

Merged
andsel merged 1 commit intoelastic:mainfrom
andsel:fix/stop_es_instances_in_tests_in_case_of_unresponsive
Apr 2, 2026
Merged

Update the ES creation helper function to teardown it in case of service not available.#18931
andsel merged 1 commit intoelastic:mainfrom
andsel:fix/stop_es_instances_in_tests_in_case_of_unresponsive

Conversation

@andsel
Copy link
Copy Markdown
Contributor

@andsel andsel commented Apr 2, 2026

Release notes

[rn:skip]

What does this PR do?

Update the ES creation helper function to teardown the service and propagate the error if it doesn't respond to license API call. This could be a sign of RED cluster, but without stopping it the integration tests would create one instance per test, becuase this is generally invoked in test fixture setup and the fixture teardown is not executed if happens in setup.

Why is it important/What is the impact to the user?

As a developer I don't want that when ES in integration test has bad times (for example high disk watermark, free < 30%) it doesn't tear down ES instances.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • [ ] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Consume space on the partition where you run the tests, free space has to go down 30%, so that ES detect a high watermark condition. Run a tests that instantiates ES like:

SPEC_OPTS="-fd -P qa/integration/management/multiple_pipelines_spec.rb" ./gradlew --rerun-tasks :logstash-xpack:rubyIntegrationTests

Related issues

Use cases

Screenshots

Logs

…opagate the error if it doesn't respond to license API call. This could be a sign of RED cluster, but without stopping it the integration tests would create one instance per test, becuase this is generally invoked in test fixture setup and the fixture teardown is not executed if happens in setup.
@andsel andsel self-assigned this Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • run exhaustive tests : Run the exhaustive tests Buildkite pipeline.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 2, 2026

This pull request does not have a backport label. Could you fix it @andsel? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@andsel andsel changed the title Update the ES creation helper function to teardown the service and pr… Update the ES creation helper function to teardown it in case of service not available. Apr 2, 2026
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

cc @andsel

@andsel andsel marked this pull request as ready for review April 2, 2026 13:10
Copy link
Copy Markdown
Contributor

@kaisecheng kaisecheng left a comment

Choose a reason for hiding this comment

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

Look good to me

@andsel andsel merged commit 0f5362d into elastic:main Apr 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants