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

[Flaky Test] Fix TestHTTPSProxy #5878

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AndersonQ
Copy link
Member

@AndersonQ AndersonQ commented Oct 30, 2024

What does this PR do?

It moves the close of the proxy and target http server to t.Cleanup()

Why is it important?

Just using defer was causing the last request log to be logged after the test had ended, what lead to a panic.

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

  • N/A

How to test this PR locally

On a Mac (the panics happened on Mac)

go test -count 10000 -timeout 0 -run TestHTTPSProxy ./testing/proxytest/

It should succeed

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?
  • ...

@AndersonQ AndersonQ added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify labels Oct 30, 2024
@AndersonQ AndersonQ self-assigned this Oct 30, 2024
@AndersonQ AndersonQ requested a review from a team as a code owner October 30, 2024 08:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@pierrehilbert
Copy link
Contributor

From what I understood, it should close the flaky test issue right?
Could you please link the PR to the issue if this is the case?

@AndersonQ
Copy link
Member Author

AndersonQ commented Oct 30, 2024

Could you please link the PR to the issue if this is the case?

My bad, I fixed it

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify backport-8.16 Automated backport with mergify skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flaky Test]: TestHTTPSProxy – data race
4 participants