-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxy
causes test errors in Deno
#598
Comments
After forking and some deep dives, I found that the
Specifically, Unfortunately Deno keep track of MessagePorts created during each test and asserts their disposal at the end of each test. I think besides best practices, |
Enjoy the coffe 😉 |
Update 2023-02-07: A port for Deno is available at https://deno.land/x/comlink, when the
npm:
protocol is mature enough I will make it compatible with both Node and Deno (and Bun). My intention to merge still holds, let me know, @surma.Update: After some deep dives, I think I can overhaul the proxy mechanism for a clean Deno support. If you want to see this happen, a coffee would do. I'll merge everything back when the author is active again.
Given this simple worker script,
It runs normally without leaking unclosed MessagePort at runtime via
deno run
:But when I wrap the code above into a Deno test case
it("should work", async () => { ... });
, the test throws the an error with messageAssertionError: Test case is leaking async ops.
Full error log (Click to expand)
I suspect this is caused by a delayed disposal of an opened MessagePort via
proxy
and Deno test doesn't like it, could anyone confirm this?The text was updated successfully, but these errors were encountered: