From a113df8c43c35c3b4523a14cc91c5749c0d9cf36 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Mon, 22 Mar 2021 18:33:14 +0300 Subject: [PATCH] [Gradle, JS] Use karma 6.0 API to set ping timeout ^KT-45621 fixed --- libraries/tools/kotlin-test-js-runner/karma-debug-framework.js | 2 +- libraries/tools/kotlin-test-js-runner/src/DebugConfigurator.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/tools/kotlin-test-js-runner/karma-debug-framework.js b/libraries/tools/kotlin-test-js-runner/karma-debug-framework.js index fa1ef977553..771eae5ea90 100644 --- a/libraries/tools/kotlin-test-js-runner/karma-debug-framework.js +++ b/libraries/tools/kotlin-test-js-runner/karma-debug-framework.js @@ -18,7 +18,7 @@ function configureTimeouts(injector) { webServer.timeout = 0 } const socketServer = injector.get('socketServer'); - if (socketServer) { + if (socketServer && typeof socketServer.set === 'function') { // Disable socket.io heartbeat (ping) to avoid browser disconnecting when debugging tests, // because no ping requests are sent when test execution is suspended on a breakpoint. // Default values are not enough for suspended execution: diff --git a/libraries/tools/kotlin-test-js-runner/src/DebugConfigurator.js b/libraries/tools/kotlin-test-js-runner/src/DebugConfigurator.js index f957ecf8a07..b2fd88eef42 100644 --- a/libraries/tools/kotlin-test-js-runner/src/DebugConfigurator.js +++ b/libraries/tools/kotlin-test-js-runner/src/DebugConfigurator.js @@ -97,4 +97,5 @@ export function fixMochaTimeout(config) { export function fixBrowserActivityTimeout(config) { config.browserNoActivityTimeout = null + config.pingTimeout = 24 * 60 * 60 * 1000 } \ No newline at end of file