diff --git a/std/examples/tests/curl_test.ts b/std/examples/tests/curl_test.ts index a36da83ba5..3e3d4f78a9 100644 --- a/std/examples/tests/curl_test.ts +++ b/std/examples/tests/curl_test.ts @@ -6,12 +6,9 @@ import { randomPort } from "../../http/test_util.ts"; const port = randomPort(); Deno.test({ name: "[examples/curl] send a request to a specified url", - // FIXME(bartlomieju): this test is leaking both resources and ops, - // and causes interference with other tests - ignore: true, fn: async () => { const server = serve({ port }); - (async (): Promise => { + const serverPromise = (async (): Promise => { for await (const req of server) { req.respond({ body: "Hello world" }); } @@ -36,8 +33,9 @@ Deno.test({ assertStrictEq(actual, expected); } finally { - process.close(); server.close(); + process.close(); + await serverPromise; } } });