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
10 changes: 9 additions & 1 deletion runtime/flybot-workspace-web/test/features.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,15 @@ test('duplicate and malformed endpoints are refused', () => {

test('runtime() resolves once the DS-Bot wrapper attaches, and times out otherwise', async () => {
detachRuntime()
await assert.rejects(runtime({ timeoutMs: 20 }), /not attached/)
// This assertion's rejection timer is unref'd, so on a host with nothing else
// holding the loop open the timer never fires and the test is cancelled
// instead of passing. Keep the loop alive until the rejection lands.
const keepAlive = setTimeout(() => {}, 1000)
try {
await assert.rejects(runtime({ timeoutMs: 20 }), /not attached/)
} finally {
clearTimeout(keepAlive)
}
const pending = runtime({ timeoutMs: 1000 })
const rt = { bots: [] }
const ctx = {}
Expand Down
7 changes: 6 additions & 1 deletion runtime/flybot-workspace-web/test/memory-extras.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,12 @@ test('automatic group capture has its own cursor and can be paused during extrac
assert.deepEqual(await toggle(true),{enabled:true})
assert.deepEqual(await toggle(true),{enabled:true},'a retried enable preserves the cursor')
assert.equal((await list()).body.group_capture,true)
await Promise.race([extracting,delay(6000,null,{ref:false}).then(()=>assert.fail('Group capture did not start'))])
// Same shape as above: neither the capture scheduler nor the race timer
// holds the loop open, so keep it alive until the race settles.
const keepAlive = setTimeout(()=>{},6000)
try {
await Promise.race([extracting,delay(6000,null,{ref:false}).then(()=>assert.fail('Group capture did not start'))])
} finally { clearTimeout(keepAlive) }
assert.deepEqual(reads,[42])
await list('POST',{enabled:false})
assert.equal((await list()).body.queued,1,'the private-chat preference is independent')
Expand Down
Loading