From aba4ed08c87c83fad4bdfae04e340954a39806ed Mon Sep 17 00:00:00 2001 From: Lucas Manuel Rodriguez Date: Wed, 23 Jul 2025 14:17:59 -0300 Subject: [PATCH] Fix host identity test (#31184) Attempt to fix https://github.com/fleetdm/fleet/actions/runs/16474702385/job/46573038570?pr=31109#step:14:841. (I cannot reproduce locally.) --- ee/server/integrationtest/hostidentity/hostidentity_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ee/server/integrationtest/hostidentity/hostidentity_test.go b/ee/server/integrationtest/hostidentity/hostidentity_test.go index 579a4a7b33..a3da83a4a5 100644 --- a/ee/server/integrationtest/hostidentity/hostidentity_test.go +++ b/ee/server/integrationtest/hostidentity/hostidentity_test.go @@ -244,6 +244,8 @@ func testOrbitEnrollment(t *testing.T, s *Suite, cert *x509.Certificate, eccPriv err = signer.Sign(req) require.NoError(t, err) + clonedRequest := req.Clone(ctx) + // Send the signed request client := fleethttp.NewClient() httpResp, err := client.Do(req) @@ -261,10 +263,11 @@ func testOrbitEnrollment(t *testing.T, s *Suite, cert *x509.Certificate, eccPriv require.NoError(t, signedEnrollResp.Err) // Send the same request again. We don't have replay protection, so it should succeed. - httpResp, err = client.Do(req) + httpResp, err = client.Do(clonedRequest) require.NoError(t, err) defer httpResp.Body.Close() require.Equal(t, http.StatusOK, httpResp.StatusCode, "Same request with HTTP signature should succeed") + // Parse the response signedEnrollResp = enrollOrbitResponse{} err = json.NewDecoder(httpResp.Body).Decode(&signedEnrollResp)