Skip to content

Commit a2ff0e2

Browse files
authored
ci/soak: doSoakTest(): name parameters (#1817)
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
1 parent b0097d2 commit a2ff0e2

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

test/e2e/soak/index.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,29 @@ async function soakTest() {
5656

5757
log.info('Setup complete. Starting soak tests...');
5858

59-
await doSoakTest('randomSubmission', 50, 1_000, 30_000, 100, n => randomSubmission(n, projectId, formId));
59+
await doSoakTest({
60+
name: 'randomSubmission',
61+
throughput: 50,
62+
throughputPeriod: 1_000,
63+
testDuration: 30_000,
64+
minimumSuccessThreshold: 100,
65+
fn: n => randomSubmission(n, projectId, formId),
66+
});
6067

6168
// TODO work out a more scientific sleep duration
6269
const backgroundJobPause = 20_000;
6370
log.info(`Sleeping ${durationForHumans(backgroundJobPause)} to allow central-backend to complete background jobs...`);
6471
await new Promise(resolve => { setTimeout(resolve, backgroundJobPause); });
6572
log.info('Woke up.');
6673

67-
await doSoakTest('exportZipWithDataAndMedia', 10, 3_000, 300_000, 0, n => exportZipWithDataAndMedia(n, projectId, formId));
74+
await doSoakTest({
75+
name: 'exportZipWithDataAndMedia',
76+
throughput: 10,
77+
throughputPeriod: 3_000,
78+
testDuration: 300_000,
79+
minimumSuccessThreshold: 0,
80+
fn: n => exportZipWithDataAndMedia(n, projectId, formId),
81+
});
6882

6983
log.info(`Check for extra logs at ${logPath}`);
7084

@@ -74,7 +88,7 @@ async function soakTest() {
7488
process.exit(0);
7589
}
7690

77-
function doSoakTest(name, throughput, throughputPeriod, testDuration, minimumSuccessThreshold, fn) {
91+
function doSoakTest({ name, throughput, throughputPeriod, testDuration, minimumSuccessThreshold, fn }) {
7892
log.info('Starting soak test:', name);
7993
log.info(' throughput:', throughput, 'per period');
8094
log.info(' throughputPeriod:', throughputPeriod, 'ms');

0 commit comments

Comments
 (0)