From e29146f9f66cf66ed70d5c610cd374121afd933b Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:31:40 +0100 Subject: [PATCH] Clear cookie jar between benchmark user setups setup() runs in a single iteration, so k6 does not reset the per-VU cookie jar between the users we create. The second user's session request carried the first user's session cookie, so the server rejected it with "session already active" (401). Clear the jar after capturing each user's cookie; flows authenticate via explicit Cookie headers, so clearing the jar is safe. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/benchmarks/http.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/benchmarks/http.js b/tests/benchmarks/http.js index 1b340b1887..a41b4778df 100644 --- a/tests/benchmarks/http.js +++ b/tests/benchmarks/http.js @@ -209,6 +209,10 @@ function setupUsers(projectId, count) { }, headers, [201], 'setup.account.session'); users.push({ sessionHeaders: { ...headers, Cookie: cookieHeader(session) } }); + + // Drop the auto-stored session cookie so the next user can sign in; + // setup() runs in a single iteration, so the jar is not reset for us. + http.cookieJar().clear(ENDPOINT); } return users;