{"record":{"id":"fff81f61bebb42c6","repo":"karatelabs/karate","slug":"isresponsive-check-failed","errorCode":null,"errorMessage":"isResponsive check failed: {}","messagePattern":"isResponsive check failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java","lineNumber":2871,"sourceCode":"     * probe Runtime.evaluate rather than Page.navigate because it's cheap and local\n     * (no network).\n     * </p>\n     */\n    @Override\n    public boolean isResponsive() {\n        if (terminated || !cdp.isOpen()) {\n            return false;\n        }\n        try {\n            CdpResponse response = cdp.method(\"Runtime.evaluate\")\n                    .param(\"expression\", \"new Promise(function(r){ setTimeout(function(){ r(true); }, 0); })\")\n                    .param(\"awaitPromise\", true)\n                    .param(\"returnByValue\", true)\n                    .timeout(Duration.ofSeconds(3))\n                    .send();\n            return !response.isError() && Boolean.TRUE.equals(response.getResult(\"result.value\"));\n        } catch (Exception e) {\n            logger.warn(\"isResponsive check failed: {}\", e.getMessage());\n            return false;\n        }\n    }\n\n    // ========== Accessors ==========\n\n    public CdpClient getCdpClient() {\n        return cdp;\n    }\n\n    @Override\n    public DriverOptions getOptions() {\n        return options;\n    }\n\n    /**\n     * Get the CDP-specific options.\n     */","sourceCodeStart":2853,"sourceCodeEnd":2889,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java#L2853-L2889","documentation":"isResponsive() sends a Runtime.evaluate (with awaitPromise, 3s timeout) to probe whether the page's JS event loop answers. On any exception (timeout, dead websocket, crashed renderer) it logs this warning and returns false. A false return means the target could not be proven responsive — callers treat this as an unresponsive page/driver.","triggerScenarios":"Page JS blocked by a long-running synchronous task or infinite loop; renderer process crashed; CDP connection dropped; evaluate exceeding the 3s timeout.","commonSituations":"Pages running heavy synchronous computation, dialogs blocking the main thread, renderer OOM/crash on large pages, or the browser being killed externally while the driver still holds the session.","solutions":["Investigate what blocks the page main thread (long tasks, alert/confirm dialogs, busy loops) in page code you control.","If the renderer crashed, re-launch the driver/quit and restart the browser.","Increase probes' tolerance in your own watchdog logic, or treat false as a signal to restart the session.","Check CI memory limits — renderer OOM is a common cause."],"exampleFix":"// before\nif (!driver.isResponsive()) { throw new RuntimeException(\"dead\"); }\n// after\nif (!driver.isResponsive()) {\n    logger.warn(\"page unresponsive, restarting driver\");\n    driver.quit();\n    driver = Driver.start(options);\n}","handlingStrategy":"try-catch","validationCode":"// probe before expensive steps\nif (!driver.isResponsive()) { driver.quit(); driver = Driver.start(options); }","typeGuard":null,"tryCatchPattern":"if (!driver.isResponsive()) {\n    logger.warn(\"browser unresponsive, restarting\");\n    driver.quit();\n    driver = Driver.start(options);\n}","preventionTips":["Avoid page code with long synchronous blocking work or blocking dialogs","Monitor CI memory to prevent renderer OOM crashes","Treat repeated false responses as a signal to restart the session","Close stray alert()/confirm() dialogs before probing"],"tags":["cdp","health-check","unresponsive-page","timeout"],"backgroundTag":"browser-unresponsive","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"}