{"record":{"id":"14a180d6b657c0da","repo":"karatelabs/karate","slug":"pruned-stale-frame-s-from-framesstillloading-remaining","errorCode":null,"errorMessage":"pruned {} stale frame(s) from framesStillLoading, remaining: {}","messagePattern":"pruned (.+?) stale frame\\(s\\) from framesStillLoading, remaining: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java","lineNumber":1566,"sourceCode":"            return;\n        }\n        try {\n            CdpResponse response = cdp.method(\"Page.getFrameTree\").send();\n            List<Map<String, Object>> childFrames = response.getResult(\"frameTree.childFrames\");\n            Set<String> activeFrameIds = new HashSet<>();\n            if (childFrames != null) {\n                for (Map<String, Object> frameData : childFrames) {\n                    Map<String, Object> frame = (Map<String, Object>) frameData.get(\"frame\");\n                    if (frame != null) {\n                        activeFrameIds.add((String) frame.get(\"id\"));\n                    }\n                }\n            }\n            int before = framesStillLoading.size();\n            framesStillLoading.removeIf(id -> !activeFrameIds.contains(id));\n            int removed = before - framesStillLoading.size();\n            if (removed > 0) {\n                logger.warn(\"pruned {} stale frame(s) from framesStillLoading, remaining: {}\", removed, framesStillLoading);\n            }\n        } catch (Exception e) {\n            logger.trace(\"stale frame check failed: {}\", e.getMessage());\n        }\n    }\n\n    /**\n     * The DOMContentLoaded signal for the document the caller is actually waiting on.\n     * When a navigation owns the wait (expectedLoaderId set by setUrl), the signal\n     * only counts if it was recorded for that navigation's loader — a stale event\n     * from the previous document (or a pool-reset about:blank) no longer qualifies.\n     * With no owning navigation (refresh/reload/back/forward, external callers) the\n     * legacy boolean applies unchanged.\n     */\n    private boolean isDomReady() {\n        String expected = expectedLoaderId;\n        if (expected != null) {\n            if (expected.equals(domContentLoaderId)) {","sourceCodeStart":1548,"sourceCodeEnd":1584,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/driver/cdp/CdpDriver.java#L1548-L1584","documentation":"During the periodic stale-frame check in waitForPageLoad, the driver prunes frame IDs from framesStillLoading that no longer exist among activeFrameIds, because the frameStoppedLoading event can be lost in CI environments. This warning reports how many stale frames were removed and what remains. It is self-healing: pruning lets the load wait proceed instead of timing out on a phantom frame.","triggerScenarios":"domContentEventFired=true with non-empty framesStillLoading, and the stale check (every ~2s) finds frame IDs not present in the set of currently active frames.","commonSituations":"CI runners where CDP Frame.stoppedLoading events are dropped, removed/destroyed iframes whose stop event never arrived, heavy parallel test load causing missed CDP events.","solutions":["No action needed if the page then loads successfully — this is the driver self-healing a lost event.","If it recurs with the same frame, inspect that iframe: it may genuinely never finish loading (fix the page or remove the frame).","Keep Chrome updated; event loss is more common on older/loaded builds.","Reduce CI parallelism if warnings correlate with timeouts."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the warning as benign when the page then loads","Fix or remove iframes that genuinely never stop loading","Keep Chrome updated to reduce lost CDP events","Reduce CI parallelism if it correlates with timeouts"],"tags":["cdp","frames","stale-state","ci-flake"],"backgroundTag":"stale-frame-state","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-16T19:17:19.609Z"}