@effectstream/orchestrator 0.101.0 → 0.101.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effectstream/orchestrator",
3
- "version": "0.101.0",
3
+ "version": "0.101.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://effectstream.github.io/docs/",
6
6
  "repository": {
@@ -32,7 +32,7 @@
32
32
  "start": "bun src/cli.ts start"
33
33
  },
34
34
  "dependencies": {
35
- "@effectstream/db": "0.101.0"
35
+ "@effectstream/db": "0.101.1"
36
36
  },
37
37
  "description": "Multi-chain local development environment for EffectStream"
38
38
  }
@@ -60,6 +60,13 @@ export function launchEvm(
60
60
  args: ["run", "chain:start"],
61
61
  waitToExit: false,
62
62
  critical: true,
63
+ // Must wait for `hardhat compile` to finish. The node's EDR provider reads
64
+ // every build-info JSON under build/artifacts/hardhat/build-info/ on
65
+ // connect; if it reads while `hardhat compile` is still writing them it
66
+ // hits a truncated file ("Failed to parse build info: EOF…"), poisoning
67
+ // the node and stalling deploy/generate-mod. COMPILE is waitToExit:true,
68
+ // so this serializes writer→reader without blocking COMPILE_FORGE.
69
+ dependsOn: [EvmNames.COMPILE],
63
70
  },
64
71
  {
65
72
  name: EvmNames.HARDHAT_WAIT,
package/src/port-check.ts CHANGED
@@ -29,7 +29,11 @@ export async function waitForPort(port: number, timeoutMs = 60_000): Promise<boo
29
29
  * Uses `lsof -ti tcp:<port>` (macOS / Linux).
30
30
  */
31
31
  export function pidsByPort(port: number): number[] {
32
- const result = Bun.spawnSync(["lsof", "-ti", `tcp:${port}`], {
32
+ // `-sTCP:LISTEN` restricts to the process LISTENING on the port. Without it,
33
+ // `lsof -ti tcp:<port>` also returns CLIENTS with an open connection to the
34
+ // port (e.g. a test harness holding a keepalive fetch to the sync API), which
35
+ // callers like freePort() would then wrongly SIGTERM.
36
+ const result = Bun.spawnSync(["lsof", "-ti", `tcp:${port}`, "-sTCP:LISTEN"], {
33
37
  stderr: "pipe",
34
38
  });
35
39
  if (result.exitCode !== 0) return [];
@@ -48,7 +52,12 @@ export function pidsByPort(port: number): number[] {
48
52
  export async function freePort(port: number): Promise<void> {
49
53
  if (!(await isPortInUse(port))) return;
50
54
 
51
- const result = Bun.spawnSync(["lsof", "-ti", `tcp:${port}`], {
55
+ // `-sTCP:LISTEN` so we only kill the listener, never a client connected to
56
+ // the port (see pidsByPort). During shutdown a template's test process often
57
+ // holds an open connection to the sync API / chain ports; without this filter
58
+ // freePort would SIGTERM the test process (and its `bun run test` wrapper),
59
+ // failing an otherwise-green run with exit 143.
60
+ const result = Bun.spawnSync(["lsof", "-ti", `tcp:${port}`, "-sTCP:LISTEN"], {
52
61
  stderr: "pipe",
53
62
  });
54
63