You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing tests for HTTP proxy I hit this bug. Given such function:
asyncfunctiontestModuleDownload(): Promise<void>{consthttp=Deno.run({args: [Deno.execPath(),"--no-prompt","--reload","fetch","http://deno.land/welcome.ts"],stdout: "piped",env: {HTTP_PROXY: `http://${addr}`}});// notice await for status twice hereawaithttp.status();consthttpStatus=awaithttp.status();assertEquals(httpStatus.code,0);http.close();}
The tests passed fine on Linux/Mac but hang on Windows. This is definitely bad behavior, I can imagine situation where you await for status in two different places.
I imagine this issue can be easily solved like this:
I also hit this bug on Mac by calling 'Deno.status()` twice at the same time.
Here is a simple reproducible example:
constp=Deno.run({cmd: [Deno.execPath(),"-V",],});conststatus=awaitPromise.all([p.status(),p.status(),]);// status never resolvesconsole.log("not printed");
Writing tests for HTTP proxy I hit this bug. Given such function:
The tests passed fine on Linux/Mac but hang on Windows. This is definitely bad behavior, I can imagine situation where you await for status in two different places.
I imagine this issue can be easily solved like this:Above solution probably won't work if status hasn't been resolved and two callers await the actual promise.
The text was updated successfully, but these errors were encountered: