-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.16.2
Node.js Version
22.11.0
Mode
WDIO Testrunner
Which capabilities are you using?
{
browserName : 'chrome',
'wdio:enforceWebDriverClassic': true,
'wdio:maxInstances' : 1,
'goog:chromeOptions' : {
args: [
'disable-gpu',
'no-sandbox',
'window-size=1440,1080',
'disable-dev-shm-usage',
'disable-notifications',
'disable-dev-tools',
'disable-translate',
'disable-infobars'
]
},
pageLoadStrategy: 'eager'
}What happened?
After migrating from async-exit-hook to exit-hook in #14511, the new exitHook() was used in a way that runs synchronously, causing Node.js to exit before cleanup could complete. As a result, after I press Ctrl+C during a WDIO run, deleteSession() was never called on SIGINT, and browser sessions remained hanging
What is your expected behavior?
When I press Ctrl+C during a WDIO run, I expect the session to be gracefully closed, and the process to exit cleanly with code 130 — not abruptly killed
How to reproduce the bug.
- Use WebdriverIO v9.16.2
- Run any WDIO test suite with a valid browser session
- While the browser is open and test is running, press Ctrl+C to send SIGINT
Result
- No deleteSession() call is made
- Node process exits immediately
Relevant log output
^C
Ending WebDriver sessions gracefully ...
(press ctrl+c again to hard kill the runner)
2025-07-01T14:59:07.568Z INFO @wdio/local-runner: Shutting down spawned worker
[0-0] FAILED in chrome - file:///src/test/specs/test.spec.ts
2025-07-01T14:59:07.578Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:04
2025-07-01T14:59:07.578Z INFO @wdio/cli:launcher: Run onComplete hookCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested