From f603035758b69c9ff68113c082c7198faf9b7303 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 9 Feb 2024 11:52:27 +0200 Subject: [PATCH] net: reduce flakyness of tcp test (#20761) --- vlib/net/dial_tcp_with_bind_test.v | 12 ++++++++++++ vlib/net/tcp_test.v | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 vlib/net/dial_tcp_with_bind_test.v diff --git a/vlib/net/dial_tcp_with_bind_test.v b/vlib/net/dial_tcp_with_bind_test.v new file mode 100644 index 0000000000..8ca2491c7e --- /dev/null +++ b/vlib/net/dial_tcp_with_bind_test.v @@ -0,0 +1,12 @@ +import net + +fn test_bind() { + $if !network ? { + return + } + eprintln(@LOCATION) + mut conn := net.dial_tcp_with_bind('vlang.io:80', '0.0.0.0:0')! + dump(conn) + conn.close()! + eprintln(@LOCATION) +} diff --git a/vlib/net/tcp_test.v b/vlib/net/tcp_test.v index 70f03f3f38..7098a33788 100644 --- a/vlib/net/tcp_test.v +++ b/vlib/net/tcp_test.v @@ -1,5 +1,3 @@ -// vtest flaky: true -// vtest retry: 8 import net const test_port = 45123 @@ -86,11 +84,3 @@ fn test_tcp_unix() { fn testsuite_end() { eprintln('\ndone') } - -fn test_bind() { - $if !network ? { - return - } - mut conn := net.dial_tcp_with_bind('vlang.io:80', '127.0.0.1:0')! - conn.close()! -}