just running scenarios on an aws server with 3 test cases, get the following error:
level=error msg=“context canceled”
Request:
sometimes, there could be additional error as “iteration interrupted”.
I believe I have set long enough duration, and the application under test doesn’t throw time out errors. It seems to me that the k6 stops the execution before the time out window is exceeded.
The gracefulStop window is 3 mins per test case, but the script stops after 1.5 min.
scenarios: (100.00%) 3 executors, 3 max VUs, 13m15s max duration (incl. graceful stop):
* TC_1: 1 iterations shared among 1 VUs (maxDuration: 10m0s, exec: da_TC_1, startTime: 1s, gracefulStop: 3m0s)
* TC_2: 1 iterations shared among 1 VUs (maxDuration: 10m0s, exec: da_TC_2, startTime: 5s, gracefulStop: 3m0s)
* TC_3: 1 iterations shared among 1 VUs (maxDuration: 10m0s, exec: da_TC_3, startTime: 10s, gracefulStop: 3m0s)
Here is my script:
let failedRequestCounter = new Counter('failedRequestCounter');
export let options = {
thresholds: {
failedRequestCounter: [{ threshold: 'count===0', abortOnFail: true}],
},
scenarios: {
TC_1: {
executor: 'shared-iterations',
exec: 'DA_TC_1',
vus: 1,
iterations: 1,
gracefulStop: '3m',
startTime: '0s',
},
TC_2: {
executor: 'shared-iterations',
exec: 'da_TC_2',
vus: 1,
iterations: 1,
startTime: '5s',
gracefulStop: '3m'
},
/*
TC_3: {
executor: 'shared-iterations',
exec: 'da_TC_3',
iterations: 1,
startTime: '10s',
gracefulStop: '3m'
},
*/
export function da_TC_1 ()
{
group("TC_1", function () {
TC_1();
});
}
export function da_TC_2 ()
{
group("TC_1", function () {
TC_2();
});
}
export function da_TC_3 ()
{
group("TC_1", function () {
TC_3();
});
}
Here are my questions:
- Why don’t gracefulStop and maxduration time window matter and k6 stops prematurely?
- how to catch the context cancel error?
Thanks
Min