From 38a3ee8082d5896bd8754e7a511ea6ca9ec8ee8d Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Sat, 25 Apr 2026 07:08:05 +0000 Subject: [PATCH] ci/soak: doSoakTest(): name parameters Convert `doSoakTest()` function arguments to named object properties. This makes it much easier to see what each number is, which is very helpful when understanding, modifying and investigating soak test failures, changes etc. Ref #1791 --- test/e2e/soak/index.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/test/e2e/soak/index.js b/test/e2e/soak/index.js index f6836f176..c9fbdfbf5 100644 --- a/test/e2e/soak/index.js +++ b/test/e2e/soak/index.js @@ -56,7 +56,14 @@ async function soakTest() { log.info('Setup complete. Starting soak tests...'); - await doSoakTest('randomSubmission', 50, 1_000, 30_000, 100, n => randomSubmission(n, projectId, formId)); + await doSoakTest({ + name: 'randomSubmission', + throughput: 50, + throughputPeriod: 1_000, + testDuration: 30_000, + minimumSuccessThreshold: 100, + fn: n => randomSubmission(n, projectId, formId), + }); // TODO work out a more scientific sleep duration const backgroundJobPause = 20_000; @@ -64,7 +71,14 @@ async function soakTest() { await new Promise(resolve => { setTimeout(resolve, backgroundJobPause); }); log.info('Woke up.'); - await doSoakTest('exportZipWithDataAndMedia', 10, 3_000, 300_000, 0, n => exportZipWithDataAndMedia(n, projectId, formId)); + await doSoakTest({ + name: 'exportZipWithDataAndMedia', + throughput: 10, + throughputPeriod: 3_000, + testDuration: 300_000, + minimumSuccessThreshold: 0, + fn: n => exportZipWithDataAndMedia(n, projectId, formId), + }); log.info(`Check for extra logs at ${logPath}`); @@ -74,7 +88,7 @@ async function soakTest() { process.exit(0); } -function doSoakTest(name, throughput, throughputPeriod, testDuration, minimumSuccessThreshold, fn) { +function doSoakTest({ name, throughput, throughputPeriod, testDuration, minimumSuccessThreshold, fn }) { log.info('Starting soak test:', name); log.info(' throughput:', throughput, 'per period'); log.info(' throughputPeriod:', throughputPeriod, 'ms');