From 0071dfdc5ced9a717c7b5008e20bf79f1b6dc78a Mon Sep 17 00:00:00 2001 From: Trivikram Kamat <16024985+trivikr@users.noreply.github.com> Date: Mon, 31 Aug 2020 08:48:58 -0700 Subject: [PATCH] update actions to run on ubuntu-18.04 (#7160) --- .github/workflows/ci.yml | 8 ++++---- cli/bench/throughput.rs | 12 +++++++++++- cli/tests/echo_server.ts | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c172b7581b..135a30d0cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,13 +17,13 @@ jobs: kind: test_release - os: windows-2019 kind: test_release - - os: ubuntu-16.04 + - os: ubuntu-18.04 kind: test_release - - os: ubuntu-16.04 + - os: ubuntu-18.04 kind: test_debug - - os: ubuntu-16.04 + - os: ubuntu-18.04 kind: bench - - os: ubuntu-16.04 + - os: ubuntu-18.04 kind: lint # Always run master branch builds to completion. This allows the cache to diff --git a/cli/bench/throughput.rs b/cli/bench/throughput.rs index 0be46f142f..74844fbed6 100644 --- a/cli/bench/throughput.rs +++ b/cli/bench/throughput.rs @@ -34,7 +34,17 @@ pub(crate) fn cat(deno_exe: &PathBuf, megs: usize) -> Result { pub(crate) fn tcp(deno_exe: &PathBuf, megs: usize) -> Result { let size = megs * MB; - let shell_cmd = format!("head -c {} /dev/zero | nc {}", size, CLIENT_ADDR); + // The GNU flavor of `nc` requires the `-N` flag to shutdown the network socket after EOF on stdin + let nc_command = if cfg!(target_os = "linux") { + "nc -N" + } else { + "nc" + }; + + let shell_cmd = format!( + "head -c {} /dev/zero | {} {}", + size, nc_command, CLIENT_ADDR + ); println!("{}", shell_cmd); let cmd = &["sh", "-c", &shell_cmd]; diff --git a/cli/tests/echo_server.ts b/cli/tests/echo_server.ts index 053bdf5c16..fc8afa9812 100644 --- a/cli/tests/echo_server.ts +++ b/cli/tests/echo_server.ts @@ -4,7 +4,7 @@ const listener = Deno.listen({ hostname, port: Number(port) }); console.log("listening on", addr); listener.accept().then( async (conn): Promise => { - await Deno.copy(conn, conn); + console.log("recieved bytes:", await Deno.copy(conn, conn)); conn.close(); listener.close(); },