Skip to content

Commit ab28b3b

Browse files
committed
test(hosting): run the unit tests in one process
The hosting unit tests run in the slowest unit test shard (shard 3, usually the last local job). node --test spawned one process per test file, each reloading the package and its dependencies; with --experimental-test-isolation=none the ~1,700 tests share one process: 125 s -> 70 s on 4 cores, all passing, 3/3 runs (UnitBench). Only hosting: core gets slower that way and bb-data hangs. It also stops the parent runner from parsing a test file's stdout, which is where dist/secret-cli.test.js failed 2 of 3 runs in one fork experiment with "Unable to deserialize cloned data due to invalid or unsupported version" (nodejs/node#64061: child stdout bytes that look like a runner frame).
1 parent 4757b80 commit ab28b3b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@aws-blocks/hosting": patch
3+
"@aws-blocks/blocks": patch
4+
---
5+
6+
chore(hosting): run the package's unit tests in one process
7+
8+
`npm test` in `@aws-blocks/hosting` now passes `--experimental-test-isolation=none`, so its ~1,700 tests share one Node process instead of one per test file (125 s → 70 s on 4 cores). No runtime change.

‎packages/hosting/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"scripts": {
6060
"build": "tsc --build && npm run bundle:handlers",
6161
"bundle:handlers": "node scripts/bundle-handlers.mjs",
62-
"test": "node --test 'dist/**/*.test.js'",
62+
"test": "node --test --experimental-test-isolation=none 'dist/**/*.test.js'",
6363
"dev": "tsc --build --watch"
6464
},
6565
"dependencies": {

0 commit comments

Comments
 (0)