Skip to content

Commit f5ce4c3

Browse files
its-mashclaude
andcommitted
fix: resolve flaky Linux E2E desktop tests
Make wdio-video-reporter opt-in (SAVE_ALL_VIDEOS=true) to prevent screenshot-during-teardown race that causes UND_ERR_SOCKET on Linux where WebKitGTK tears down synchronously on deleteSession. Also upgrade E2E workflow to Node 22 so --experimental-strip-types fixtures work without retry storms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 09c19aa commit f5ce4c3

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/e2e-desktop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- uses: pnpm/action-setup@v4
5555
- uses: actions/setup-node@v4
5656
with:
57-
node-version: 20
57+
node-version: 22
5858
cache: 'pnpm'
5959

6060
# Cache pnpm store for faster installs

tests/e2e/wdio.conf.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,17 @@ export const config: Options.Testrunner = {
344344
return `wdio-junit-${options.cid}.xml`;
345345
},
346346
}],
347-
[video, {
348-
saveAllVideos: process.env.SAVE_ALL_VIDEOS === 'true', // Save all videos when env var is set
349-
videoSlowdownMultiplier: 1, // Normal speed
350-
outputDir: './tests/e2e/videos/',
351-
}],
347+
// Only enable video reporter when explicitly requested via SAVE_ALL_VIDEOS=true.
348+
// The video reporter takes a screenshot after every WebDriver command, including
349+
// during session teardown. This races with deleteSession killing the Tauri app,
350+
// causing UND_ERR_SOCKET errors that mark passing specs as FAILED.
351+
...(process.env.SAVE_ALL_VIDEOS === 'true'
352+
? [[video, {
353+
saveAllVideos: true,
354+
videoSlowdownMultiplier: 1,
355+
outputDir: './tests/e2e/videos/',
356+
}]]
357+
: []),
352358
],
353359

354360
mochaOpts: {
@@ -490,6 +496,11 @@ export const config: Options.Testrunner = {
490496
// the next spec's beforeSession to avoid racing with WebdriverIO's own
491497
// deleteSession call, which would cause cascading failures in subsequent specs.
492498
afterSession: async function () {
499+
// Mark as crashed to prevent afterTest screenshot attempts against a dying session.
500+
// On Linux, WebKitGTK tears down the process synchronously on deleteSession,
501+
// so any pending screenshot requests will hit a dead socket.
502+
tauriDriverCrashed = true;
503+
493504
closeTauriDriver();
494505

495506
// Brief pause to let tauri-driver/mcpmux handle SIGTERM gracefully

0 commit comments

Comments
 (0)