Description
I run multiple test scenario in a jenkins pipeline
When all test are finished to run, i get stuck in this step until my configured timeout trigger the end of the pipeline
-- FAILURES:
✖ "after all" hook: codeceptjs.afterSuite in "MyScenario" in 10ms
It's occurs randomly and by waves. Always at the end of the codeceptjs script, i presume in the teardown / cleanup step.
It's look that occurs only on jenkins, when i run test locally everything works.
This is the last log i've got from codecetp, after that, it's timeout from jenkins
... some codeceptjs steps
--- ENDED "before each" hook: Before for "Test scenario @smoketest" ---
... some codeceptjs steps
... last instructions
✔ OK in 1806ms
--- STARTED "after each" hook: After for "Test scenario @smoketest" ---
I delete fake user "[email protected]"
I delete fake workspace "[email protected]"
I delete fake user preferences "[email protected]"
--- ENDED "after each" hook: After for "Test scenario @smoketest" ---
-- FAILURES:
✖ "after all" hook: codeceptjs.afterSuite in "Test Feature" in 6ms
Cancelling nested steps due to timeout
Sending interrupt signal to process
10:22:30.290166 common.go:40: exit status 1
script returned exit code 1
I don't know how to debug this behavior, it's very annoying because all test in the pipeline are down in few minutes, but get stuck
Can someone help me to debug this strange behavior ?
Thanks
Details
- CodeceptJS version: 3.3.7
- NodeJS Version: 18.15.0
- Operating System: Linux & Windows same behavior
- Playwright: 1.32.1
exports.config = {
tests: ['./tests/**/*_test.ts', './tests/**/test.ts'],
output: './output',
helpers: {
Playwright: {
url: config.base_url,
show: true,
trace: true,
browser: 'chromium',
chromium: {
args: ['--auth-server-whitelist=""'],
},
ignoreHTTPSErrors: true,
fullPageScreenshots: true,
waitForAction: 250,
waitForTimeout: 10000,
waitForNavigation: 'load',
restart: 'context',
keepCookies: false,
keepBrowserState: false,
basicAuth: {
username: defaultUser.email,
password: defaultUser.password,
},
},
},
include: {
I: './custom-steps.ts',
},
bootstrap: null,
mocha: {},
name: 'e2e',
plugins: {
autoLogin: {
enabled: true,
saveToFile: false,
inject: 'autoLoginAs',
users: {
basicUser: getAutoLoginMethods(defaultUser, '$clientName-label'),
},
},
pauseOnFail: {},
customLocator: {
enabled: true,
attribute: 'data-e2e',
strategy: 'css',
showActual: true,
},
retryFailedStep: {
enabled: true,
},
retryTo: {
enabled: true,
pollInterval: 100,
},
tryTo: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
},
allure: {
outputDir: './output/allure-results',
},
},
};
One more thing, we have on every Scenario add the retry(3)
option to avoid flakyness
We already notice that retry
avoid log error when test is failing like reported in this issue #3439