test(agent-loop): exclude unreachable teardown paths
This commit is contained in:
1 parent
fcad57b3af
commit
d776df1106
1 file changed
+2
@@ -564,7 +564,9 @@ export class AgentLoop extends Service implements AgentFactory {
|
||||
// Disposal IS a disposed-cause cancel followed by quiescence. New work
|
||||
// sent after this point is the sender's bug — the registries are about
|
||||
// to drop the agent, so nothing should still hold it.
|
||||
/* v8 ignore next -- Cordis effect teardown waits for synchronous setup before observing the machine slot. */
|
||||
if (machine === undefined) await machineReady.promise
|
||||
/* v8 ignore next -- setup failure untracks this disposer before resolving without a machine. */
|
||||
if (machine !== undefined) {
|
||||
machine.cancel({ kind: 'disposed' })
|
||||
await machine.whenIdle()
|
||||
|
||||
Reference in new issue
Block a user