fix(code-runtime): bound completion measurement
This commit is contained in:
@@ -219,6 +219,15 @@ describe('WorkerCodeRuntime — budgets and containment (real workers)', () => {
|
||||
expect(after.value).toBe('alive')
|
||||
}, 30_000)
|
||||
|
||||
it('reports a worker that exits before publishing a completion', async () => {
|
||||
const { runtime } = await setup()
|
||||
const result = await runtime.run({ program: 'process.exit(7)', bindings: [] })
|
||||
expect(result).toEqual({
|
||||
logs: [],
|
||||
error: { kind: 'worker-exit', message: 'worker exited with code 7 before completing' },
|
||||
})
|
||||
})
|
||||
|
||||
it('fails runaway log output explicitly while retaining a bounded prefix', async () => {
|
||||
const { runtime } = await setup({ maxOutputBytes: 300 })
|
||||
const result = await runtime.run({
|
||||
|
||||
@@ -13,7 +13,7 @@ it('boots the source worker without workspace package outputs', async () => {
|
||||
const directory = await mkdtemp(join(tmpdir(), 'dsh-code-source-worker-'))
|
||||
let worker: Worker | undefined
|
||||
try {
|
||||
const files = ['worker.ts', 'bootstrap.ts', 'protocol.ts', 'worker-json.ts']
|
||||
const files = ['worker.ts', 'bootstrap.ts', 'protocol.ts', 'worker-json.ts', 'output-json.ts']
|
||||
await Promise.all(files.map(async (file) => {
|
||||
await copyFile(new URL(`../src/${file}`, import.meta.url), join(directory, file))
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user