From 10d5fb25b6319532313a3bda144c6e1a3a8c0bf4 Mon Sep 17 00:00:00 2001 From: Dale Hamel Date: Fri, 24 Feb 2023 13:47:40 -0500 Subject: Fix off by one error in test It doesn't affect the test outcome, but it is not the intended behaviour of the test. We listen once to find out what port to use, then should bind with SO_REUSEPORT N-1 times, but we are doing it N times, so we have one extra listener. --- test/test_linux_reuseport_tcp_listen_stats.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_linux_reuseport_tcp_listen_stats.rb b/test/test_linux_reuseport_tcp_listen_stats.rb index c977c43..73995ea 100644 --- a/test/test_linux_reuseport_tcp_listen_stats.rb +++ b/test/test_linux_reuseport_tcp_listen_stats.rb @@ -36,7 +36,7 @@ class TestLinuxReuseportTcpListenStats < Test::Unit::TestCase listeners = 10 _, port = new_socket_server(reuseport: true) addr = "#{TEST_ADDR}:#{port}" - listeners.times do + (listeners - 1).times do new_socket_server(reuseport: true, port: port) end -- cgit v1.2.3-24-ge0c7