summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/echo_server.ts2
-rwxr-xr-xtools/http_benchmark.py12
2 files changed, 6 insertions, 8 deletions
diff --git a/cli/tests/echo_server.ts b/cli/tests/echo_server.ts
index 48b43aca6..deab17397 100644
--- a/cli/tests/echo_server.ts
+++ b/cli/tests/echo_server.ts
@@ -1,4 +1,4 @@
-const addr = Deno.args[1] || "0.0.0.0:4544";
+const addr = Deno.args[0] || "0.0.0.0:4544";
const [hostname, port] = addr.split(":");
const listener = Deno.listen({ hostname, port: Number(port) });
console.log("listening on", addr);
diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py
index a4576695c..b92ce756e 100755
--- a/tools/http_benchmark.py
+++ b/tools/http_benchmark.py
@@ -14,19 +14,17 @@ import third_party
# "deno_http" was once called "deno_net_http"
DURATION = "20s"
-
-LAST_PORT = 4544
+NEXT_PORT = 4544
def server_addr(port):
return "0.0.0.0:%s" % port
-def get_port(port=None):
- global LAST_PORT
- if port is None:
- port = LAST_PORT
- LAST_PORT = LAST_PORT + 1
+def get_port():
+ global NEXT_PORT
+ port = NEXT_PORT
+ NEXT_PORT += 1
# Return port as str because all usages below are as a str and having it an
# integer just adds complexity.
return str(port)