Skip to content

Commit b5fac27

Browse files
committed
WIP: Try different quit approach for CI
1 parent 5ea6b3e commit b5fac27

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

test/smoke.spec.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ test('app launches and loads UI from server', async () => {
55
const electronApp = await electron.launch({
66
cwd: path.join(import.meta.dirname, '..'),
77
args: ['.'],
8-
timeout: 60000
8+
timeout: 60000,
9+
...(process.env.CI && { env: { ...process.env, ELECTRON_ENABLE_LOGGING: '1' } })
910
});
1011

1112
electronApp.process().stdout?.on('data', (data) => {
@@ -23,18 +24,6 @@ test('app launches and loads UI from server', async () => {
2324
await expect(window.locator('h1:has-text("Intercept HTTP")')).toBeVisible({ timeout: 60000 });
2425
console.log('saw title');
2526

26-
await Promise.race([
27-
electronApp.close(),
28-
new Promise((_, reject) => setTimeout(() => reject(new Error('App failed to close cleanly')), 5000))
29-
]).catch(async (error) => {
30-
console.warn('Warning:', error.message, '- force killing process');
31-
electronApp.process().kill('SIGKILL');
32-
if (!process.env.CI) {
33-
console.log('(Note that shutdown issues like this are ignored in CI)');
34-
throw error;
35-
} else {
36-
console.log('Ignoring error (assuming this is a CI issue)')
37-
}
38-
});
27+
await electronApp.close();
3928
console.log('closed app');
4029
});

0 commit comments

Comments
 (0)