Skip to content

Commit bb6be38

Browse files
committed
fix : add logic to abort test execution when max devworkspaces target is reached
Instead of returning from each VU iteration after checking number of currently running DevWorkspaces, abort the test execution to save time and reduce load on K8s apiserver. Signed-off-by: Rohan Kumar <[email protected]>
1 parent 81d2ec4 commit bb6be38

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/load/devworkspace_load_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import http from 'k6/http';
1717
import {check, sleep} from 'k6';
1818
import {Trend, Counter} from 'k6/metrics';
19+
import { test } from 'k6/execution';
1920
import {htmlReport} from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js";
2021
import {textSummary} from "https://jslib.k6.io/k6-summary/0.0.1/index.js";
2122

@@ -92,7 +93,7 @@ export default function () {
9293
if (maxDevWorkspaces > 0) {
9394
const totalDevWorkspaces = getDevWorkspacesFromApiServer().length;
9495
if (totalDevWorkspaces > maxDevWorkspaces) {
95-
return;
96+
test.abort('Max concurrent DevWorkspaces target achieved, stopping test gracefully', { abortOnFail: false });
9697
}
9798
}
9899
const vuId = __VU;

0 commit comments

Comments
 (0)