Skip to content

Commit 4630b01

Browse files
committed
fix(executions): use the shared flushMacrotask helper for the stall sentinel
1 parent 256430f commit 4630b01

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/sim/lib/workflows/executor/execution-status.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { dbChainMockFns, queueTableRows, resetDbChainMock, schemaMock } from '@sim/testing'
2+
import { flushMacrotask } from '@sim/testing/helpers/async'
23
import { asyncJobsMock, asyncJobsMockFns } from '@sim/testing/mocks/async-jobs.mock'
34
import { traceStoreMock, traceStoreMockFns } from '@sim/testing/mocks/trace-store.mock'
4-
import { sleep } from '@sim/utils/helpers'
55
import { and } from 'drizzle-orm'
66
import { beforeEach, describe, expect, it, vi } from 'vitest'
77

@@ -585,7 +585,7 @@ describe('getWorkflowExecutionStatus polls that read no execution data', () => {
585585

586586
/** Settles with {@link STALLED} instead of hanging when the read waits on the archive. */
587587
function readOrStall(read: Parameters<typeof getWorkflowExecutionStatus>[0]) {
588-
return Promise.race([getWorkflowExecutionStatus(read), sleep(0).then(() => STALLED)])
588+
return Promise.race([getWorkflowExecutionStatus(read), flushMacrotask().then(() => STALLED)])
589589
}
590590

591591
beforeEach(() => {

0 commit comments

Comments
 (0)