Skip to content

chore(enterprise): do not fail test on unexpected request #15781

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

Closed
wants to merge 2 commits into from

Conversation

dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Dec 9, 2024

Fixes coder/internal#280

Likely similar to

if r.URL.Path == "/derp" {
// The /derp endpoint is used by wireguard clients to tunnel
// through coderd. For some reason these requests don't set
// a Host header properly sometimes in tests (no idea how),
// which causes this path to get hit.

Alternatively (or additionally) we could have the FakeIDP.httpHandler handle the /derp path, but in general we probably shouldn't be failing these tests on a logged error?

@dannykopping dannykopping changed the title chore(enterprise): Do not fail test on unexpected request chore(enterprise): do not fail test on unexpected request Dec 9, 2024
Signed-off-by: Danny Kopping <[email protected]>
@dannykopping dannykopping requested a review from Emyrk December 9, 2024 09:27
@Emyrk
Copy link
Member

Emyrk commented Dec 10, 2024

I think the failed test on logged error might actually be correct here.

The test in question that is failing is calling /derp on the idp, which makes no sense. At no point should we be making that call to that endpoint.

I wonder if the unit tests are reusing ports, and it used to be a coderd, but now it's a fake IDP on that port? In which case, tests are not cleaning up correctly?

Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

I want to understand why this is failing first. I think the failure is reasonable, and something else is happening.

If we push this, it might be hiding a cleanup issue, or a call to the wrong server?

@dannykopping
Copy link
Contributor Author

Gotcha 👍 that's fair. I thought this might be a timing issue (or something similarly flaky), but if it's indicative of something actually incorrect then absolutely we shouldn't paper over it.

@Emyrk
Copy link
Member

Emyrk commented Dec 10, 2024

Gotcha 👍 that's fair. I thought this might be a timing issue (or something similarly flaky), but if it's indicative of something actually incorrect then absolutely we shouldn't paper over it.

I haven't looked deep yet, so maybe it is timing. But I cannot think of a reason that route should be called on the IDP. If it's a test teardown thing, that sounds like a pain to debug 😢

@github-actions github-actions bot added the stale This issue is like stale bread. label Dec 18, 2024
@github-actions github-actions bot closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flake: TestGroupSync/RemoveAllGroups
2 participants