diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 62419393c3..e133e56f0d 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -437,11 +437,12 @@ jobs: -camera-front none -timezone US/Pacific script: | + pgrep -f appium ./scripts/e2e.mjs ${{ matrix.platform }} --test # For some reason there's another appium process running that prevents the emulator to stop. # We need to kill it manually. pgrep -f appium - pkill -f appium + pkill -f appium || echo - uses: actions/cache@v4 if: ${{ matrix.platform == 'ios' }} diff --git a/scripts/e2e.mjs b/scripts/e2e.mjs index 5034e742ce..e950e9bc0d 100755 --- a/scripts/e2e.mjs +++ b/scripts/e2e.mjs @@ -225,7 +225,7 @@ if (actions.includes('test')) { await newProcess('adb logcat', adbLogProcess); } - // execSync(`yarn test --verbose`, { stdio: 'inherit', cwd: e2eDir, env: testEnv }); + execSync(`yarn test --verbose`, { stdio: 'inherit', cwd: e2eDir, env: testEnv }); } finally { for (const [name, info] of Object.entries(processesToKill)) { console.log(`Sending termination signal to process '${name}' (${info.process.pid})`); @@ -243,6 +243,10 @@ if (actions.includes('test')) { clearTimeout(killTimeout); console.log(`Process '${name}' (${info.process.pid}) exited with code ${code}`); + + // In CI, there's still an issue with the process staying alive after the parent process has exited, + // blocking the pipeline indefinitely. This detaches the child process from the parent process. + if (env.CI) info.process.unref(); } } }