From 735b2648590d0e973015dc4a064eac7965167725 Mon Sep 17 00:00:00 2001 From: Richard Davison Date: Sun, 17 Nov 2024 22:24:23 +0100 Subject: [PATCH 1/4] Debug --- .github/workflows/build.yml | 2 ++ abort-ctrl-qemu.js | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 abort-ctrl-qemu.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3efba9ba2..399eedc5b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,7 @@ jobs: msystem: MINGW64 update: true path-type: inherit + release: false install: >- mingw-w64-x86_64-make mingw-w64-x86_64-cmake @@ -103,6 +104,7 @@ jobs: qemu-user make CURRENT_TARGET=aarch64-unknown-linux-musl test-ci + cargo +nightly run --target=aarch64-unknown-linux-musl -r -- ./abort-ctrl-qemu.js - name: Build Linux binaries if: inputs.release && inputs.platform == 'linux' run: | diff --git a/abort-ctrl-qemu.js b/abort-ctrl-qemu.js new file mode 100644 index 0000000000..0c7c39476e --- /dev/null +++ b/abort-ctrl-qemu.js @@ -0,0 +1,24 @@ +import net from "net"; + +const server = net.createServer((socket) => { + socket.on("data", () => { + socket.write( + "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n" + ); + socket.end(); + }); +}); +server.listen(() => { + const { port } = server.address(); + const url = `http://localhost:${port}`; + + for (let i = 0; i < 1 * 1000 * 1000; i++) { + const abortController = new AbortController(); + const res = fetch(url, { signal: abortController.signal }); + abortController.abort(); + if (i % 10000 === 0) { + console.log(i); + } + } + server.close(); +}); From e50b652cbc20b353c824f30c259f412e04590533 Mon Sep 17 00:00:00 2001 From: Richard Davison Date: Sun, 17 Nov 2024 22:37:14 +0100 Subject: [PATCH 2/4] Move test sooner --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 399eedc5b7..a134edcf08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,8 +103,9 @@ jobs: qemu-utils \ qemu-user - make CURRENT_TARGET=aarch64-unknown-linux-musl test-ci cargo +nightly run --target=aarch64-unknown-linux-musl -r -- ./abort-ctrl-qemu.js + make CURRENT_TARGET=aarch64-unknown-linux-musl test-ci + - name: Build Linux binaries if: inputs.release && inputs.platform == 'linux' run: | From e2c4ea02f6f9a2f5fe2cf6c74f54b17990502895 Mon Sep 17 00:00:00 2001 From: Richard Davison Date: Sun, 17 Nov 2024 22:42:38 +0100 Subject: [PATCH 3/4] Test --- .github/workflows/build.yml | 1 - Makefile | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a134edcf08..a688d9fdea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,6 @@ jobs: qemu-utils \ qemu-user - cargo +nightly run --target=aarch64-unknown-linux-musl -r -- ./abort-ctrl-qemu.js make CURRENT_TARGET=aarch64-unknown-linux-musl test-ci - name: Build Linux binaries diff --git a/Makefile b/Makefile index 7a78917870..4e62bccf5a 100644 --- a/Makefile +++ b/Makefile @@ -188,6 +188,7 @@ test-e2e: js test-ci: export JS_MINIFY = 0 test-ci: export RUST_BACKTRACE = 1 test-ci: clean-js | toolchain js + cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- ./abort-ctrl-qemu.js cargo $(TOOLCHAIN) -Z build-std -Z build-std-features test --target $(CURRENT_TARGET) -- --nocapture --show-output cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- test -d bundle/js/__tests__/unit From 2148261d364f182bd7296a53f4a2183a02c16eff Mon Sep 17 00:00:00 2001 From: Richard Davison Date: Sun, 17 Nov 2024 23:20:49 +0100 Subject: [PATCH 4/4] Test --- Makefile | 1 - abort-ctrl-qemu.js | 24 ------------------- llrt_core/src/modules/js/@llrt/test/index.ts | 5 ++-- llrt_core/src/modules/js/@llrt/test/worker.ts | 2 ++ 4 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 abort-ctrl-qemu.js diff --git a/Makefile b/Makefile index 4e62bccf5a..7a78917870 100644 --- a/Makefile +++ b/Makefile @@ -188,7 +188,6 @@ test-e2e: js test-ci: export JS_MINIFY = 0 test-ci: export RUST_BACKTRACE = 1 test-ci: clean-js | toolchain js - cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- ./abort-ctrl-qemu.js cargo $(TOOLCHAIN) -Z build-std -Z build-std-features test --target $(CURRENT_TARGET) -- --nocapture --show-output cargo $(TOOLCHAIN) run -r --target $(CURRENT_TARGET) -- test -d bundle/js/__tests__/unit diff --git a/abort-ctrl-qemu.js b/abort-ctrl-qemu.js deleted file mode 100644 index 0c7c39476e..0000000000 --- a/abort-ctrl-qemu.js +++ /dev/null @@ -1,24 +0,0 @@ -import net from "net"; - -const server = net.createServer((socket) => { - socket.on("data", () => { - socket.write( - "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n" - ); - socket.end(); - }); -}); -server.listen(() => { - const { port } = server.address(); - const url = `http://localhost:${port}`; - - for (let i = 0; i < 1 * 1000 * 1000; i++) { - const abortController = new AbortController(); - const res = fetch(url, { signal: abortController.signal }); - abortController.abort(); - if (i % 10000 === 0) { - console.log(i); - } - } - server.close(); -}); diff --git a/llrt_core/src/modules/js/@llrt/test/index.ts b/llrt_core/src/modules/js/@llrt/test/index.ts index b7aafc3d33..ce026c0e15 100644 --- a/llrt_core/src/modules/js/@llrt/test/index.ts +++ b/llrt_core/src/modules/js/@llrt/test/index.ts @@ -75,7 +75,7 @@ type TestFailure = { }; class TestServer extends EventEmitter { - private static UPDATE_FPS = 15; + private static UPDATE_FPS = 1; private static UPDATE_INTERVAL_MS = 1000 / TestServer.UPDATE_FPS; private static DEFAULT_TIMEOUT_MS = parseInt((process.env as any).TEST_TIMEOUT) || 5000; @@ -191,6 +191,7 @@ class TestServer extends EventEmitter { } ); proc.stdout.on("data", (data) => { + console.log(data.toString()); output = data; }); proc.on("error", (error) => { @@ -649,6 +650,6 @@ class TestServer extends EventEmitter { } const testServer = new TestServer((globalThis as any).__testEntries, { - workerCount: undefined, + workerCount: 1, }); await testServer.start(); diff --git a/llrt_core/src/modules/js/@llrt/test/worker.ts b/llrt_core/src/modules/js/@llrt/test/worker.ts index aad95737d7..4f59f77293 100644 --- a/llrt_core/src/modules/js/@llrt/test/worker.ts +++ b/llrt_core/src/modules/js/@llrt/test/worker.ts @@ -300,6 +300,8 @@ class TestAgent { started = performance.now(); + console.log("Testing: ", test.desc); + await this.executeAsyncOrCallbackFn(test.fn, test.timeout); const end = performance.now();