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

Merged
merged 4 commits into from
Oct 31, 2024

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

@AndersonQ AndersonQ enabled auto-merge (squash) October 30, 2024 14:31
Copy link

@AndersonQ AndersonQ merged commit 02fb75e into elastic:main Oct 31, 2024
14 checks passed
mergify bot pushed a commit that referenced this pull request Oct 31, 2024
(cherry picked from commit 02fb75e)

# Conflicts:
#	testing/proxytest/proxytest_test.go
mergify bot pushed a commit that referenced this pull request Oct 31, 2024
(cherry picked from commit 02fb75e)

# Conflicts:
#	testing/proxytest/proxytest_test.go
@AndersonQ AndersonQ deleted the 5869-flaky-test-TestHTTPSProxy branch October 31, 2024 14:23
AndersonQ added a commit that referenced this pull request Oct 31, 2024
(cherry picked from commit 02fb75e)

# Conflicts:
#	testing/proxytest/proxytest_test.go
AndersonQ added a commit that referenced this pull request Oct 31, 2024
(cherry picked from commit 02fb75e)

# Conflicts:
#	testing/proxytest/proxytest_test.go
AndersonQ added a commit that referenced this pull request Nov 4, 2024
AndersonQ added a commit that referenced this pull request Nov 4, 2024
AndersonQ added a commit that referenced this pull request Nov 4, 2024
AndersonQ added a commit that referenced this pull request Nov 4, 2024
AndersonQ added a commit that referenced this pull request Nov 5, 2024
(cherry picked from commit 02fb75e)

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Nov 22, 2024
(cherry picked from commit 02fb75e)

---------

Co-authored-by: Anderson Queiroz <[email protected]>
AndersonQ added a commit that referenced this pull request Dec 2, 2024
… closing the server (#5970)

* (backport #5878) proxytest: fix log after test finished (#5878)

(cherry picked from commit 02fb75e)

---------

Co-authored-by: Anderson Queiroz <[email protected]>

* (backport #5950) [proxytest] Await requests before server shutdown #5970

(cherry picked from commit e423d73)

---------

Co-authored-by: Anderson Queiroz <[email protected]>
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