Fix FRE-4928 P1 review findings: setup() data passing, EXIT_CODE capture
- P1#1: Document constant-arrival-rate limitation (no setup() data to scenarios) - P1#2: Capture EXIT_CODE inside each case branch to avoid set -e truncation Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -268,30 +268,25 @@ export function mixedWorkload() {
|
||||
}
|
||||
|
||||
// Individual endpoint scenarios — each makes exactly 1 HTTP call per iteration
|
||||
// NOTE: constant-arrival-rate executor does not pass setup() data to scenario functions.
|
||||
// Standalone runs always use fake tokens (expected 401/403). For real-token testing,
|
||||
// run as part of the mixedWorkload scenario or switch to vus executor.
|
||||
export function loginOnly() {
|
||||
testLogin();
|
||||
sleep(0.1);
|
||||
}
|
||||
|
||||
export function logoutOnly(data) {
|
||||
if (data && data.warmupSuccess) {
|
||||
testLogout(data.accessToken, data.refreshToken);
|
||||
} else {
|
||||
const poolEntry = tokenPool[Math.floor(Math.random() * tokenPool.length)];
|
||||
console.warn('[logoutOnly] Using fake token (warmup skipped or failed)');
|
||||
testLogout(poolEntry.accessToken, poolEntry.refreshToken);
|
||||
}
|
||||
export function logoutOnly() {
|
||||
const poolEntry = tokenPool[Math.floor(Math.random() * tokenPool.length)];
|
||||
console.warn('[logoutOnly] Using fake token (constant-arrival-rate does not pass setup() data)');
|
||||
testLogout(poolEntry.accessToken, poolEntry.refreshToken);
|
||||
sleep(0.1);
|
||||
}
|
||||
|
||||
export function refreshOnly(data) {
|
||||
if (data && data.warmupSuccess) {
|
||||
testRefresh(data.refreshToken);
|
||||
} else {
|
||||
const poolEntry = tokenPool[Math.floor(Math.random() * tokenPool.length)];
|
||||
console.warn('[refreshOnly] Using fake token (warmup skipped or failed)');
|
||||
testRefresh(poolEntry.refreshToken);
|
||||
}
|
||||
export function refreshOnly() {
|
||||
const poolEntry = tokenPool[Math.floor(Math.random() * tokenPool.length)];
|
||||
console.warn('[refreshOnly] Using fake token (constant-arrival-rate does not pass setup() data)');
|
||||
testRefresh(poolEntry.refreshToken);
|
||||
sleep(0.1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user