From c7e17c8066827d3f1891b14d075e1c3ff730d46e Mon Sep 17 00:00:00 2001 From: Victor Lyuboslavsky <2685025+getvictor@users.noreply.github.com> Date: Thu, 31 Jul 2025 19:49:02 +0200 Subject: [PATCH] Fix flaky host identity test. (#31446) --- ee/server/integrationtest/hostidentity/hostidentity_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ee/server/integrationtest/hostidentity/hostidentity_test.go b/ee/server/integrationtest/hostidentity/hostidentity_test.go index c7d20cd756..4b14266761 100644 --- a/ee/server/integrationtest/hostidentity/hostidentity_test.go +++ b/ee/server/integrationtest/hostidentity/hostidentity_test.go @@ -17,6 +17,7 @@ import ( "encoding/json" "encoding/pem" "fmt" + "io" mathrand "math/rand/v2" "net/http" "os" @@ -267,7 +268,9 @@ func testOrbitEnrollment(t *testing.T, s *Suite, cert *x509.Certificate, eccPriv err = signer.Sign(req) require.NoError(t, err) + // Clone the request before sending it to preserve the body clonedRequest := req.Clone(ctx) + clonedRequest.Body = io.NopCloser(bytes.NewReader(reqBody)) // Send the signed request client := fleethttp.NewClient()