diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-10-15 13:35:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-15 13:35:04 +0200 |
commit | 8283d37c51a8fd5f92ba3f8be0bb26f241f864b6 (patch) | |
tree | a29a2cb41e9165fc9700106061dfb734de83a296 | |
parent | 9c7a5c0c616eb309b582d61b61b9ef1cc4526909 (diff) |
bench: avoid port collision (#16285)
-rw-r--r-- | cli/bench/http.rs | 3 | ||||
-rw-r--r-- | core/examples/http_bench_json_ops.js | 4 | ||||
-rw-r--r-- | core/examples/http_bench_json_ops.rs | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/cli/bench/http.rs b/cli/bench/http.rs index a656ee708..7c02a37e4 100644 --- a/cli/bench/http.rs +++ b/cli/bench/http.rs @@ -191,8 +191,9 @@ fn server_addr(port: u16) -> String { } fn core_http_json_ops(exe: &str) -> Result<HttpBenchmarkResult> { + // let port = get_port(); println!("http_benchmark testing CORE http_bench_json_ops"); - run(&[exe], 4544, None, None, None) + run(&[exe], 4570, None, None, None) } fn hyper_http(exe: &str) -> Result<HttpBenchmarkResult> { diff --git a/core/examples/http_bench_json_ops.js b/core/examples/http_bench_json_ops.js index 98b2f4ef8..883ef1752 100644 --- a/core/examples/http_bench_json_ops.js +++ b/core/examples/http_bench_json_ops.js @@ -9,7 +9,7 @@ const responseBuf = new Uint8Array( .map((c) => c.charCodeAt(0)), ); -/** Listens on 0.0.0.0:4500, returns rid. */ +/** Listens on 0.0.0.0:4570, returns rid. */ function listen() { return Deno.core.ops.op_listen(); } @@ -38,7 +38,7 @@ async function serve(rid) { async function main() { const listenerRid = listen(); - Deno.core.print(`http_bench_ops listening on http://127.0.0.1:4544/\n`); + Deno.core.print(`http_bench_ops listening on http://127.0.0.1:4570/\n`); while (true) { const rid = await accept(listenerRid); diff --git a/core/examples/http_bench_json_ops.rs b/core/examples/http_bench_json_ops.rs index 6d61d35ec..6eaa99a38 100644 --- a/core/examples/http_bench_json_ops.rs +++ b/core/examples/http_bench_json_ops.rs @@ -130,7 +130,7 @@ fn create_js_runtime() -> JsRuntime { #[op] fn op_listen(state: &mut OpState) -> Result<ResourceId, Error> { log::debug!("listen"); - let addr = "127.0.0.1:4544".parse::<SocketAddr>().unwrap(); + let addr = "127.0.0.1:4570".parse::<SocketAddr>().unwrap(); let std_listener = std::net::TcpListener::bind(&addr)?; std_listener.set_nonblocking(true)?; let listener = TcpListener::try_from(std_listener)?; |