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

test: use a lower unenroll timeout in TestActionUnenrollHandler #5465

Merged
merged 2 commits into from
Sep 9, 2024

Conversation

kruskall
Copy link
Member

@kruskall kruskall commented Sep 7, 2024

What does this PR do?

auto unenroll with no running components is timing out after 15s due to hardcoded unenrollTimeout.
There is no need to use a huge timeout in test. Pass the timeout as a method arg and use a lower timeout.

Test time went from 15s to 0.1s

Why is it important?

slow tests are not good

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
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

How to test this PR locally

go test ./internal/pkg/agent/application/actions/handlers/. -run=TestActionUnenrollHandler/auto_unenroll_with_no_running_components -v

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

auto unenroll with no running components is timing out after 15s due to
hardcoded unenrollTimeout.
There is no need to use a huge timeout in test.
Pass the timeout as a method arg and use a lower timeout.

Test time went from 15s to 0.1s
@kruskall kruskall requested a review from a team as a code owner September 7, 2024 19:25
Copy link
Contributor

mergify bot commented Sep 7, 2024

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

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip label Sep 7, 2024
@kruskall kruskall added enhancement New feature or request skip-changelog labels Sep 7, 2024
@kruskall kruskall merged commit bc852c0 into elastic:main Sep 9, 2024
15 checks passed
@kruskall kruskall deleted the test/perf-testunenroll branch September 9, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants