raindrops.git  about / heads / tags
real-time stats for preforking Rack servers
   commit 10d5fb25b6319532313a3bda144c6e1a3a8c0bf4 (patch)
   parent a5902f2 Fix queue stats for sockets with SO_REUSEPORT
     tree 93da035fafdcddea79b53a00fc60adaa79559bd8
   author Dale Hamel <dale.hamel@shopify.com>  2023-02-24 13:47:40 -0500
committer Eric Wong <bofh@yhbt.net>            2023-02-24 19:02:18 +0000

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
 


glossary
--------
Commit objects reference one tree, and zero or more parents.

Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.

Multiple parents means the commit is a merge.

Root commits have no ancestor.  Note that it is
possible to have multiple root commits when merging independent histories.

Every commit references one top-level tree object.

git clone http://yhbt.net/raindrops.git