Commit 09c19aa
committed
fix: prevent cascading e2e test failures after tauri-driver crash
The root cause of the Linux CI failure was that when server-lifecycle.wdio.ts
(worker 0-7) crashed, ALL subsequent workers (0-8 through 0-12) failed with
"Failed to create a session" due to cascading process cleanup issues.
The problem was in the afterSession/beforeSession lifecycle:
- afterSession called pkill -9 tauri-driver while WebdriverIO's deleteSession
was still in-flight, causing connection errors
- afterSession called stopMockServers() which could kill mock servers needed
by subsequent specs
- No readiness check existed, so new tauri-driver instances started before
the previous one fully released resources (ports, locks)
Changes:
- Move aggressive cleanup (pkill -9, killMcpmuxProcesses, fuser) from
afterSession to beforeSession, executed BEFORE spawning new tauri-driver
- afterSession now only sends graceful SIGTERM via closeTauriDriver()
- Remove stopMockServers() from closeTauriDriver() (mock servers are
started once in onPrepare and should live across all specs)
- Add waitForTauriDriverReady() health check that polls GET /status
before letting WebdriverIO create a session
- Free gateway port 45818 between specs to prevent binding conflicts
- Add stopMockServers() to onShutdown handler as safety net
Result: 12/13 specs pass (up from 7/13). Only the actually crashing spec
(server-lifecycle.wdio.ts) fails; all subsequent specs recover cleanly.
Signed-off-by: Claude <noreply@anthropic.com>
https://claude.ai/code/session_01N5WUgi8V1zVQBHVw96eVzM
Signed-off-by: Claude <noreply@anthropic.com>1 parent c71bee5 commit 09c19aa
1 file changed
Lines changed: 59 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
213 | 230 | | |
| 231 | + | |
| 232 | + | |
214 | 233 | | |
215 | 234 | | |
216 | 235 | | |
| |||
277 | 296 | | |
278 | 297 | | |
279 | 298 | | |
280 | | - | |
| 299 | + | |
281 | 300 | | |
282 | 301 | | |
| 302 | + | |
283 | 303 | | |
284 | 304 | | |
285 | 305 | | |
| |||
399 | 419 | | |
400 | 420 | | |
401 | 421 | | |
402 | | - | |
403 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
404 | 426 | | |
405 | 427 | | |
406 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
407 | 448 | | |
408 | 449 | | |
409 | 450 | | |
| |||
437 | 478 | | |
438 | 479 | | |
439 | 480 | | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
440 | 486 | | |
441 | 487 | | |
442 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
443 | 492 | | |
444 | 493 | | |
445 | 494 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 495 | + | |
452 | 496 | | |
453 | 497 | | |
454 | 498 | | |
| |||
0 commit comments