Skip to content
Merged
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
7 changes: 4 additions & 3 deletions core/test/retired-bot-paths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ test('#1786: a retired Bot is not brought along by a lagging review, while a liv
assert.match(await tool('archive_bot', { bot: 'Writer' }, 'm1'), /^Archived Writer\./)
// Coder's turn ends: it is the member that brings the others along.
ctx.emit('agent/status', { agent: { id: 'g3' }, status: 'idle' })
await waitFor(() => (existsSync(memoryFile('m1')) ? true : undefined))
await settle()
await settle()
// Deterministic: the two reviews this turn launches (the member that ended and the
// live lagging member) are async. Wait for both to be recorded rather than for a fixed
// number of ticks, which is what made this assertion race on a busy CI runner.
await waitFor(() => (requests.length >= 2 && existsSync(memoryFile('m1')) ? true : undefined))
// Coder's own turn and the live lagging member are reviewed; the retired Bot is not.
assert.deepEqual(requests.map(request => request.sessionId).sort(), ['b3', 'm1'],
`only live members are reviewed: ${JSON.stringify(requests.map(request => request.sessionId))}`)
Expand Down
7 changes: 4 additions & 3 deletions patches/ds-bot/files/test/retired-bot-paths.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ test('#1786: a retired Bot is not brought along by a lagging review, while a liv
assert.match(await tool('archive_bot', { bot: 'Writer' }, 'm1'), /^Archived Writer\./)
// Coder's turn ends: it is the member that brings the others along.
ctx.emit('agent/status', { agent: { id: 'g3' }, status: 'idle' })
await waitFor(() => (existsSync(memoryFile('m1')) ? true : undefined))
await settle()
await settle()
// Deterministic: the two reviews this turn launches (the member that ended and the
// live lagging member) are async. Wait for both to be recorded rather than for a fixed
// number of ticks, which is what made this assertion race on a busy CI runner.
await waitFor(() => (requests.length >= 2 && existsSync(memoryFile('m1')) ? true : undefined))
// Coder's own turn and the live lagging member are reviewed; the retired Bot is not.
assert.deepEqual(requests.map(request => request.sessionId).sort(), ['b3', 'm1'],
`only live members are reviewed: ${JSON.stringify(requests.map(request => request.sessionId))}`)
Expand Down
Loading