Skip to content

bug(deno): adapter.test.ts isolation — handle-1 leaks across tests #161

Description

@momics

Summary

packages/iroh-http-deno/test/adapter.test.ts fails when run as a whole file: after the publicKeyVerify test closes its node (handle 1), the next test (serve — no pending ops remain after signal abort (regression #115)) emits an uncaught promise rejection IrohHandleError: node closed or not found (handle 1). Each test passes in isolation when run with --filter.

Reproduction

deno test --allow-all packages/iroh-http-deno/test/adapter.test.ts

Reproduces on a clean main (verified by stashing the #155 fix — same failure, 5 passed / 4 failed).

Suspect path

A background polling task started during the previous test (likely a connection-event loop attached to handle 1) survives node.close() and observes the closed handle in the next tick, surfacing as an uncaught promise.

Acceptance criteria

  1. deno test --allow-all packages/iroh-http-deno/test/adapter.test.ts runs the full file with no failures.
  2. Either the surviving polling loop is properly joined on close(), or the surviving promise is awaited / cancelled before the next test starts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low prioritybugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions