mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 08:03:39 +00:00
Replace Promise.resolve() with vi.waitFor in PTY claim test
Wait explicitly for the providerSpawn call to be made using vi.waitFor() instead of relying on event-loop yielding. This makes the test more deterministic and reduces flakiness from timing assumptions.
This commit is contained in:
@@ -505,9 +505,7 @@ describe('registerPtyHandlers', () => {
|
||||
ORCA_WORKTREE_ID: 'repo-1::/tmp'
|
||||
}
|
||||
}) as Promise<{ id: string }>
|
||||
await Promise.resolve()
|
||||
|
||||
expect(providerSpawn).toHaveBeenCalledTimes(1)
|
||||
await vi.waitFor(() => expect(providerSpawn).toHaveBeenCalledTimes(1))
|
||||
resolveSpawn({ id: 'pty-shared' })
|
||||
await expect(Promise.all([runtimeSpawn, rendererSpawn])).resolves.toEqual([
|
||||
{ id: 'pty-shared' },
|
||||
|
||||
Reference in New Issue
Block a user