diff options
author | Luca Casonato <hello@lcas.dev> | 2021-11-09 12:10:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 12:10:21 +0100 |
commit | 75793baae83123f890442c5d32e3dd38eb18ce1c (patch) | |
tree | 0d14bd5edbe28c3beebe9f0944437a89e0e3f724 /cli | |
parent | 31fde9deba6d4ca55293d60a030babd8d4ce12af (diff) |
Revert "refactor(ext/http): rewrite hyper integration and fix bug (#12332)" (#12704)
This reverts commit 5b1e537446454f6332de44adbeb6a15ff072c2fa.
Diffstat (limited to 'cli')
-rw-r--r-- | cli/tests/unit/http_test.ts | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts index dd2c6fc73..d947282db 100644 --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -7,7 +7,6 @@ import { assert, assertEquals, assertRejects, - assertStrictEquals, assertThrows, deferred, delay, @@ -387,7 +386,7 @@ unitTest( Deno.errors.Http, "connection closed", ); - // The error from `op_http_accept` reroutes to `respondWith()`. + // The error from `op_http_request_next` reroutes to `respondWith()`. assertEquals(await nextRequestPromise, null); listener.close(); })(); @@ -866,7 +865,6 @@ unitTest( const writer = writable.getWriter(); async function writeResponse() { - await delay(50); await writer.write( new TextEncoder().encode( "written to the writable side of a TransformStream", @@ -1001,39 +999,3 @@ unitTest( await Promise.all([server(), client()]); }, ); - -// https://github.com/denoland/deno/pull/12332 -unitTest( - { permissions: { net: true } }, - async function httpConnConcurrentNextRequestCalls() { - const hostname = "localhost"; - const port = 4501; - - async function server() { - const listener = Deno.listen({ hostname, port }); - const tcpConn = await listener.accept(); - const httpConn = Deno.serveHttp(tcpConn); - const promises = new Array(10).fill(null).map(async (_, i) => { - const event = await httpConn.nextRequest(); - assert(event); - const { pathname } = new URL(event.request.url); - assertStrictEquals(pathname, `/${i}`); - const response = new Response(`Response #${i}`); - await event.respondWith(response); - }); - await Promise.all(promises); - httpConn.close(); - listener.close(); - } - - async function client() { - for (let i = 0; i < 10; i++) { - const response = await fetch(`http://${hostname}:${port}/${i}`); - const body = await response.text(); - assertStrictEquals(body, `Response #${i}`); - } - } - - await Promise.all([server(), delay(100).then(client)]); - }, -); |