test(lsp): accept eager dead-slot eviction
This commit is contained in:
@@ -282,8 +282,9 @@ describe('lsp-local end to end over a fake server', () => {
|
|||||||
readonly instances: ReadonlyMap<string, { readonly dead: boolean }>
|
readonly instances: ReadonlyMap<string, { readonly dead: boolean }>
|
||||||
}).instances
|
}).instances
|
||||||
const instance = [...instances.values()][0]
|
const instance = [...instances.values()][0]
|
||||||
if (instance === undefined) throw new Error('expected one pooled LSP instance')
|
// The query's finally may already have observed the exit and evicted the dead slot. When the
|
||||||
await waitFor(async () => instance.dead)
|
// slot remains, synchronize with its close before proving the next query replaces it.
|
||||||
|
if (instance !== undefined) await waitFor(async () => instance.dead)
|
||||||
expect(await ctx.lsp.query(query('goToDefinition'))).toMatchObject({ kind: 'locations' })
|
expect(await ctx.lsp.query(query('goToDefinition'))).toMatchObject({ kind: 'locations' })
|
||||||
await ctx.fiber.dispose()
|
await ctx.fiber.dispose()
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user