Skip to content

Commit 1566022

Browse files
committed
test(search): finish later batched reads first so the order assertion can fail
1 parent a2b0de2 commit 1566022

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎apps/sim/lib/knowledge/mcp/server.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ describe('batched document reads', () => {
215215
mocks.liveRead.mockImplementation(async ({ input }: { input: { documentId: string } }) => {
216216
inFlight++
217217
peak = Math.max(peak, inFlight)
218-
await Promise.resolve()
218+
const laterFinishesFirst = 10 - Number(input.documentId.slice('doc-'.length))
219+
for (let tick = 0; tick < laterFinishesFirst; tick++) await Promise.resolve()
219220
inFlight--
220221
return readResult(input.documentId)
221222
})

0 commit comments

Comments
 (0)