Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions packages/engine/src/__tests__/engine/adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('PlainAdapter', () => {

await expect(
adapter.executeAction('slow_node', handler, ctx, { timeout: 50 }),
).rejects.toThrow("timed out after 50ms")
).rejects.toThrow('timed out after 50ms')
})

it('handler that completes quickly with generous timeout succeeds', async () => {
Expand Down Expand Up @@ -139,9 +139,9 @@ describe('PlainAdapter', () => {
}
const ctx = makeCtx()

await expect(
shortAdapter.executeAction('default_timeout', handler, ctx, {}),
).rejects.toThrow(ActionTimeoutError)
await expect(shortAdapter.executeAction('default_timeout', handler, ctx, {})).rejects.toThrow(
ActionTimeoutError,
)
})

it('config.timeout overrides defaultTimeout', async () => {
Expand Down Expand Up @@ -198,6 +198,7 @@ describe('Adapter integration with engine', () => {
return handler(context)
},
),
executeParallel: async (branches, _strategy) => Promise.all(branches.map((b) => b())),
}

const engine = new FlowprintEngine({ adapter: mockAdapter })
Expand Down Expand Up @@ -255,6 +256,7 @@ describe('Adapter lifecycle', () => {
init: initFn,
shutdown: shutdownFn,
executeAction: async (_nodeId, handler, ctx) => handler(ctx),
executeParallel: async (branches, _strategy) => Promise.all(branches.map((b) => b())),
}

await lifecycleAdapter.init?.()
Expand Down
Loading