From 5bc44cee392715566efc9b9605f04c39bd98d643 Mon Sep 17 00:00:00 2001 From: Michal Harakal Date: Sun, 7 Jun 2026 09:49:01 +0200 Subject: [PATCH] test(ci): harden Karma browser tests against launch flakiness under allTests During `allTests` (run on every CI PR/push) ~20 wasmJs/js *BrowserTest tasks each start a ChromeHeadless instance concurrently. On a loaded machine a browser can exceed Karma's default capture/activity timeouts and get dropped ("Disconnected, no message in 30000 ms" / "ChromeHeadless was not killed"), after which Karma discovers zero tests and Gradle fails the build on its `failOnNoDiscoveredTests` check -- even though the tests pass in isolation. This surfaced as :skainet-data:skainet-data-api:wasmJsBrowserTest failing. Add a karma.config.d/skainet-browser-resilience.js to every browser-test module (merged into karma.conf.js by the Kotlin Gradle plugin) that raises the capture/disconnect/no-activity timeouts and adds disconnect tolerance, so a CPU-starved browser is waited on instead of abandoned. Applied across all browser modules so the flakiness can't simply hop to a different one. Verified: `./gradlew allTests --rerun-tasks` green (all browser tasks re-executed concurrently, 2m41s). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ .../skainet-browser-resilience.js | 20 +++++++++++++++++++ 23 files changed, 460 insertions(+) create mode 100644 skainet-backends/skainet-backend-api/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-backends/skainet-backend-cpu/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-compile/skainet-compile-core/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-compile/skainet-compile-dag/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-compile/skainet-compile-hlo/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-compile/skainet-compile-json/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-compile/skainet-compile-opt/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-data/skainet-data-api/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-data/skainet-data-media/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-data/skainet-data-simple/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-data/skainet-data-transform/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-io/skainet-io-core/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-io/skainet-io-gguf/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-io/skainet-io-image/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-io/skainet-io-iree-params/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-io/skainet-io-onnx/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-io/skainet-io-safetensors/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-lang/skainet-lang-core/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-lang/skainet-lang-dag/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-lang/skainet-lang-ksp-annotations/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-lang/skainet-lang-models/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-models/skainet-model-yolo/karma.config.d/skainet-browser-resilience.js create mode 100644 skainet-pipeline/karma.config.d/skainet-browser-resilience.js diff --git a/skainet-backends/skainet-backend-api/karma.config.d/skainet-browser-resilience.js b/skainet-backends/skainet-backend-api/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-backends/skainet-backend-api/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-backends/skainet-backend-cpu/karma.config.d/skainet-browser-resilience.js b/skainet-backends/skainet-backend-cpu/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-backends/skainet-backend-cpu/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-compile/skainet-compile-core/karma.config.d/skainet-browser-resilience.js b/skainet-compile/skainet-compile-core/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-compile/skainet-compile-core/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-compile/skainet-compile-dag/karma.config.d/skainet-browser-resilience.js b/skainet-compile/skainet-compile-dag/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-compile/skainet-compile-dag/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-compile/skainet-compile-hlo/karma.config.d/skainet-browser-resilience.js b/skainet-compile/skainet-compile-hlo/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-compile/skainet-compile-hlo/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-compile/skainet-compile-json/karma.config.d/skainet-browser-resilience.js b/skainet-compile/skainet-compile-json/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-compile/skainet-compile-json/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-compile/skainet-compile-opt/karma.config.d/skainet-browser-resilience.js b/skainet-compile/skainet-compile-opt/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-compile/skainet-compile-opt/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-data/skainet-data-api/karma.config.d/skainet-browser-resilience.js b/skainet-data/skainet-data-api/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-data/skainet-data-api/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-data/skainet-data-media/karma.config.d/skainet-browser-resilience.js b/skainet-data/skainet-data-media/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-data/skainet-data-media/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-data/skainet-data-simple/karma.config.d/skainet-browser-resilience.js b/skainet-data/skainet-data-simple/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-data/skainet-data-simple/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-data/skainet-data-transform/karma.config.d/skainet-browser-resilience.js b/skainet-data/skainet-data-transform/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-data/skainet-data-transform/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-io/skainet-io-core/karma.config.d/skainet-browser-resilience.js b/skainet-io/skainet-io-core/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-io/skainet-io-core/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-io/skainet-io-gguf/karma.config.d/skainet-browser-resilience.js b/skainet-io/skainet-io-gguf/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-io/skainet-io-gguf/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-io/skainet-io-image/karma.config.d/skainet-browser-resilience.js b/skainet-io/skainet-io-image/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-io/skainet-io-image/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-io/skainet-io-iree-params/karma.config.d/skainet-browser-resilience.js b/skainet-io/skainet-io-iree-params/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-io/skainet-io-iree-params/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-io/skainet-io-onnx/karma.config.d/skainet-browser-resilience.js b/skainet-io/skainet-io-onnx/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-io/skainet-io-onnx/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-io/skainet-io-safetensors/karma.config.d/skainet-browser-resilience.js b/skainet-io/skainet-io-safetensors/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-io/skainet-io-safetensors/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-lang/skainet-lang-core/karma.config.d/skainet-browser-resilience.js b/skainet-lang/skainet-lang-core/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-lang/skainet-lang-core/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-lang/skainet-lang-dag/karma.config.d/skainet-browser-resilience.js b/skainet-lang/skainet-lang-dag/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-lang/skainet-lang-dag/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-lang/skainet-lang-ksp-annotations/karma.config.d/skainet-browser-resilience.js b/skainet-lang/skainet-lang-ksp-annotations/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-lang/skainet-lang-ksp-annotations/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-lang/skainet-lang-models/karma.config.d/skainet-browser-resilience.js b/skainet-lang/skainet-lang-models/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-lang/skainet-lang-models/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-models/skainet-model-yolo/karma.config.d/skainet-browser-resilience.js b/skainet-models/skainet-model-yolo/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-models/skainet-model-yolo/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +}); diff --git a/skainet-pipeline/karma.config.d/skainet-browser-resilience.js b/skainet-pipeline/karma.config.d/skainet-browser-resilience.js new file mode 100644 index 00000000..53d77540 --- /dev/null +++ b/skainet-pipeline/karma.config.d/skainet-browser-resilience.js @@ -0,0 +1,20 @@ +// SKaiNET: harden Karma browser tests against launch/capture flakiness. +// +// During `./gradlew allTests` many wasmJs/js browser test tasks start a +// ChromeHeadless instance at the same time. On a loaded machine the browser +// can take longer than Karma's defaults to capture or to emit progress, so +// Karma disconnects it ("Disconnected, no message in 30000 ms" / +// "ChromeHeadless was not killed"), ends up discovering zero tests and the +// build fails on Gradle's `failOnNoDiscoveredTests` check — even though the +// tests pass fine when the task runs in isolation. +// +// Generous capture/disconnect/no-activity timeouts plus a few disconnect +// retries make the run wait patiently for a starved browser instead of +// giving up. Kotlin's Gradle plugin merges every *.js here into karma.conf.js. +config.set({ + captureTimeout: 120000, + browserDisconnectTimeout: 30000, + browserDisconnectTolerance: 3, + browserNoActivityTimeout: 120000, + pingTimeout: 120000, +});