|
15 | 15 | - **Fix**: Allow auto-initialization when `manualStart` is false |
16 | 16 | - **Impact**: Tests with `Before()` hooks now work properly with restart=browser mode |
17 | 17 |
|
18 | | -### 3. ⚠️ Per-Test Config with Session Mode + Workers (LIMITATION DOCUMENTED) |
| 18 | +### 3. ✅ Process Hanging After Tests Complete (FIXED) |
| 19 | +**Problem**: Process doesn't exit after all tests pass, hangs indefinitely |
| 20 | +- **Root Cause**: Playwright's internal event loops keep the process alive even after cleanup |
| 21 | +- **File**: `lib/helper/Playwright.js` `_cleanup()` method |
| 22 | +- **Fix**: Add delayed auto-exit (2 seconds) after cleanup completes |
| 23 | +- **Details**: |
| 24 | + - Uses `setTimeout().unref()` to allow natural exit if possible |
| 25 | + - Only exits if no other exit handlers are registered |
| 26 | + - Respects existing `process.exitCode` |
| 27 | + - Can be disabled with `CODECEPT_DISABLE_AUTO_EXIT=1` environment variable |
| 28 | +- **Impact**: Tests now exit cleanly within 2 seconds after completion |
| 29 | + |
| 30 | +### 4. ⚠️ Per-Test Config with Session Mode + Workers (LIMITATION DOCUMENTED) |
19 | 31 | **Problem**: Per-test `.config()` doesn't work in BROWSER_RESTART=session mode with workers |
20 | 32 | - **Root Cause**: `teardown()` afterEach hooks don't execute in worker/pool mode |
21 | 33 | - **Evidence**: File logging showed config changes applied but restore callbacks never fired |
|
27 | 39 | - **Affected Tests**: 18 tests from `config_test.js` and `session_test.js` |
28 | 40 | - **Workaround Applied**: Changed CI workflow to avoid the problematic combination |
29 | 41 |
|
30 | | -### 4. ⚠️ Selector Registration Conflicts (NEW ISSUE) |
| 42 | +### 5. ⚠️ Selector Registration Conflicts (NEW ISSUE) |
31 | 43 | **Problem**: BROWSER_RESTART=context with workers causes selector registration conflicts |
32 | 44 | - **Error**: `browser.newContext: "__value" selector engine has been already registered` |
33 | 45 | - **Root Cause**: Custom selectors are registered globally on the Playwright module instance (module-level variable) |
|
0 commit comments