Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/load/scenarios/03-concurrent-uploads.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ export default function () {
});
}

// Short think time — real users don't upload at maximum machine speed
// Short think time — real users don't upload at maximum machine speed.
// Math.random() is safe here: adds non-cryptographic timing jitter to simulate realistic user think-time.
// Not a security-sensitive use case (no token generation, secret material, or authentication involved).
sleep(1 + Math.random());
}
6 changes: 5 additions & 1 deletion tests/load/scenarios/06-full-stress.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export const options = {

export default function () {
const vuSuffix = String(__VU);
// Math.random() is safe here: selects which request type this VU exercises (40/30/20/10 weighted split).
// Not a security-sensitive use case (no token generation, secret material, or authentication involved).
const roll = Math.random();

let res;
Expand Down Expand Up @@ -141,6 +143,8 @@ export default function () {
stressErrors.add(1);
}

// Very short sleep — we want to maintain pressure
// Very short sleep — we want to maintain pressure.
// Math.random() is safe here: adds non-cryptographic timing jitter to simulate realistic user think-time.
// Not a security-sensitive use case (no token generation, secret material, or authentication involved).
sleep(0.2 + Math.random() * 0.3);
}
4 changes: 3 additions & 1 deletion tests/load/scenarios/08-screening-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ export default function () {
if (res.status >= 500) screeningErrors.add(1);
}

// Think time before next iteration
// Think time before next iteration.
// Math.random() is safe here: adds non-cryptographic timing jitter to simulate realistic user think-time.
// Not a security-sensitive use case (no token generation, secret material, or authentication involved).
sleep(3 + Math.random() * 2);
}
4 changes: 3 additions & 1 deletion tests/load/scenarios/09-soak.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ export default function () {
}

// Think time — keeps the pattern realistic and gives the server brief
// breathing room between journey completions
// breathing room between journey completions.
// Math.random() is safe here: adds non-cryptographic timing jitter to simulate realistic user think-time.
// Not a security-sensitive use case (no token generation, secret material, or authentication involved).
sleep(2 + Math.random() * 2);
}
Loading