{"record":{"id":"8db1fc41b00ab40d","repo":"karatelabs/karate","slug":"driver-failed-post-reset-liveness-probe-will-discard","errorCode":null,"errorMessage":"Driver failed post-reset liveness probe, will discard","messagePattern":"Driver failed post-reset liveness probe, will discard","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/driver/PooledDriverProvider.java","lineNumber":399,"sourceCode":"            driver.clearCookies();\n            // Barrier on readiness before reuse: setUrl(\"about:blank\") returns early\n            // (about: URLs skip waitForPageLoad), so the fresh execution context may\n            // still be settling. waitUntilReady() blocks until it is live so the next\n            // scenario's first call never races a not-yet-ready context. No-op on\n            // backends that establish readiness synchronously.\n            driver.waitUntilReady();\n        } catch (Exception e) {\n            // Reset itself failed — channel is already sick (setUrl timeout, websocket closed, etc.)\n            logger.warn(\"Error resetting driver state, will discard: {}\", e.getMessage());\n            return false;\n        }\n        // Post-reset liveness probe. setUrl(\"about:blank\") can succeed on a driver that\n        // will still hang on the next http:// navigation (seen after tab-switch.feature —\n        // about:blank is local so Chrome handles it even when network-facing navigation\n        // is stuck). A bounded Runtime.evaluate catches the degraded state before we\n        // return the driver to the pool.\n        if (!driver.isResponsive()) {\n            logger.warn(\"Driver failed post-reset liveness probe, will discard\");\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Create a new driver from config.\n     * Subclasses should override for custom driver creation (e.g., Testcontainers).\n     * <p>\n     * With no {@code webSocketUrl} each pooled driver launches its own browser process,\n     * so slots are isolated by construction. Against a SHARED browser the isolation has\n     * to be asked for: a browser-level endpoint gets each slot its own incognito context\n     * via {@link CdpDriver#connectNewContext}, because pooled slots sharing one browser\n     * context share its cookie jar, and the per-acquire {@code clearCookies()} in\n     * {@link #resetDriver} is context-wide — one slot resetting would wipe the cookies of\n     * every other slot mid-scenario.\n     * </p>\n     * <p>","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/driver/PooledDriverProvider.java#L381-L417","documentation":"After resetDriver() succeeds (setUrl to about:blank returned), the provider runs a bounded liveness probe via driver.isResponsive(). A driver can pass about:blank (local, no network) but still hang on real http:// navigations; failing the probe means the pool discards it rather than handing a degraded driver to the next scenario.","triggerScenarios":"driver.isResponsive() returns false immediately after a successful reset when the driver is re-borrowed from the pool (takeHealthyFromPool / waitForDriver path).","commonSituations":"Chrome wedged after tab-switch scenarios (network-facing navigation hangs while about:blank still works); compositor/paint stalls that an eval probe catches; renderer near-OOM.","solutions":["None needed — the pool discards the driver and creates a replacement","If recurring, restart the browser process between suites or cap pool lifetime (recycle after N scenarios)","Investigate scenarios that switch tabs/close targets before finishing, which wedge the shared page target"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// after acquiring, confirm real readiness beyond about:blank\ndriver.setUrl(baseUrl); // small cheap page\nif (!driver.isResponsive()) { /* request replacement */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restart the browser after tab-heavy scenarios","Avoid scenarios that close/switch the shared page target","Bound navigation waits so wedged drivers surface quickly"],"tags":["driver-pool","liveness-probe","cdp","browser-hang"],"backgroundTag":"broken-pipe","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}