yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
From: Lin Jen-Shin <godfat@godfat.org>
To: yahns-public@yhbt.net
Cc: Lin Jen-Shin <godfat@godfat.org>
Subject: [PATCH 2/2] @srv.shutdown could raise Errno::ENOTCONN
Date: Sat,  8 Dec 2018 08:30:19 +0000	[thread overview]
Message-ID: <20181208083019.4374-2-godfat@godfat.org> (raw)
In-Reply-To: <20181208083019.4374-1-godfat@godfat.org>

After this fix, all tests except test_client_expire are
passing on my system (macos 10.12.6). Honestly, I don't
really care if it's working perfectly fine. It's just
nice to be able to run the same server on development
machine. Production is of course Linux.
---
 test/test_bin.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/test_bin.rb b/test/test_bin.rb
index 6d4faf6..fc85992 100644
--- a/test/test_bin.rb
+++ b/test/test_bin.rb
@@ -99,7 +99,10 @@ def bin_daemon(worker, inherit)
       # Even with a synchronous FD_CLOEXEC, there's a chance of a race
       # because the server does not bind right away.
       unless inherit
-        @srv.shutdown
+        begin
+          @srv.shutdown
+        rescue Errno::ENOTCONN
+        end
         @srv.close
       end
       exec(*@cmd)
-- 
2.19.2


  reply	other threads:[~2018-12-08  8:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-08  8:30 [PATCH 1/2] Add QueueQuitter#closed? to queue_quitter_pipe.rb Lin Jen-Shin
2018-12-08  8:30 ` Lin Jen-Shin [this message]
2018-12-08 11:36 ` Eric Wong
2018-12-08 11:52   ` Lin Jen-Shin (godfat)
2018-12-08 17:20     ` Eric Wong
2018-12-09  8:49       ` Lin Jen-Shin (godfat)

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/yahns/README

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

  git send-email \
    --in-reply-to=20181208083019.4374-2-godfat@godfat.org \
    --to=godfat@godfat.org \
    --cc=yahns-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/yahns.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).