diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts index e1a050c73d..99af959cc3 100644 --- a/cli/tests/unit/net_test.ts +++ b/cli/tests/unit/net_test.ts @@ -515,8 +515,6 @@ unitTest( unitTest( { - // FIXME(bartlomieju) - ignore: true, perms: { net: true }, }, async function netCloseWriteSuccess() { @@ -537,36 +535,11 @@ unitTest( assertEquals(1, buf[0]); assertEquals(2, buf[1]); assertEquals(3, buf[2]); - // Check write should be closed + // Verify that the write end of the socket is closed. + // TODO(piscisaureus): assert that thrown error is of a specific type. await assertThrowsAsync(async () => { await conn.write(new Uint8Array([1, 2, 3])); - }, Deno.errors.BrokenPipe); - closeDeferred.resolve(); - listener.close(); - conn.close(); - }, -); - -unitTest( - { - // FIXME(bartlomieju) - ignore: true, - perms: { net: true }, - }, - async function netDoubleCloseWrite() { - const addr = { hostname: "127.0.0.1", port: 3500 }; - const listener = Deno.listen(addr); - const closeDeferred = deferred(); - listener.accept().then(async (conn) => { - await closeDeferred; - conn.close(); }); - const conn = await Deno.connect(addr); - conn.closeWrite(); // closing write - assertThrows(() => { - // Duplicated close should throw error - conn.closeWrite(); - }, Deno.errors.NotConnected); closeDeferred.resolve(); listener.close(); conn.close(); diff --git a/runtime/ops/net.rs b/runtime/ops/net.rs index 364f1c5768..aa97be00b0 100644 --- a/runtime/ops/net.rs +++ b/runtime/ops/net.rs @@ -346,10 +346,7 @@ async fn op_shutdown( args: Value, _zero_copy: BufVec, ) -> Result { - super::check_unstable2(&state, "Deno.shutdown"); - let args: ShutdownArgs = serde_json::from_value(args)?; - let rid = args.rid as u32; let resource = state