ReviewOS

also looking at this

stacks/rpx

[DO NOT MERGE] diag: #2267 CLI-hang discriminator

#2269
Closed chris wants to merge diag/2267-cli-hang into main
5 files +370 -6
packages/rpx/test/zz-2267-diagnostic.test.tsadded+27-0
Changes to packages/rpx/test/zz-2267-diagnostic.test.ts
@@ -0,0 +1,27 @@
1/**
2 * TEMPORARY — #2267 diagnostic, standalone file. Not for merge.
3 *
4 * `bun test` orders files deterministically but not alphabetically; this one
5 * lands at position 38 of 48, fifteen files after `gateway.test.ts` (23), so it
6 * answers "does the failing shape hang from a parent with the graph loaded, at
7 * a LATER point in the suite?" The in-situ copy of the same sweep inside
8 * `gateway.test.ts` answers it at the position where the hang was recorded.
9 * Both import the rpx graph on purpose. The test always passes; the log is the
10 * result, every line prefixed `[2267-diag]`.
11 */
12import { describe, expect, it } from 'bun:test'
13import * as path from 'node:path'
14import { readGatewayFragments } from '../src/gateway'
15import * as Start from '../src/start'
16import { envDump, runSweep, say } from './helpers/spawn-diag'
17
18const CLI = path.join(import.meta.dir, '..', 'bin', 'cli.ts')
19
20describe('2267 diagnostic (standalone file)', () => {
21 it('records how each spawn variant of the CLI behaves here', async () => {
22 envDump()
23 say('parent graph loaded:', typeof Start.startProxies, typeof readGatewayFragments)
24 const results = await runSweep(CLI, 'standalone')
25 expect(results).toHaveLength(8)
26 }, 200_000)
27})