raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Dale Hamel <dale.hamel@shopify.com>
To: dale.hamel@shopify.com
Cc: raindrops-public@yhbt.net
Subject: [PATCH] Fix off by one error in test
Date: Fri, 24 Feb 2023 13:47:40 -0500	[thread overview]
Message-ID: <20230224184740.52419-1-dale.hamel@shopify.com> (raw)
In-Reply-To: <20230224183544.51837-1-dale.hamel@shopify.com>

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 @@ def test_reuseport_queue_stats
     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
 
-- 
2.39.2


  reply	other threads:[~2023-02-24 18:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 18:35 [PATCH] Fix queue stats for sockets with SO_REUSEPORT Dale Hamel
2023-02-24 18:47 ` Dale Hamel [this message]
2023-02-24 19:09 ` Eric Wong
2023-02-24 19:42   ` Dale Hamel
2023-02-25  0:36     ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230224184740.52419-1-dale.hamel@shopify.com \
    --to=dale.hamel@shopify.com \
    --cc=raindrops-public@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/raindrops.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).