From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-2.0 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.kgio.general Subject: [PATCH 2/3] test/lib_read_write: wait for readability before tryread Date: Wed, 11 Jul 2012 15:34:57 -0700 Message-ID: <1342046098-27952-3-git-send-email-normalperson@yhbt.net> References: <1342046098-27952-1-git-send-email-normalperson@yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342046135 15035 80.91.229.3 (11 Jul 2012 22:35:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2012 22:35:35 +0000 (UTC) To: kgio@librelist.org Original-X-From: kgio@librelist.org Thu Jul 12 00:35:34 2012 Return-path: Envelope-to: gclrkg-kgio@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kgio@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.kgio.general:179 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sp5VO-0003px-0N for gclrkg-kgio@m.gmane.org; Thu, 12 Jul 2012 00:35:34 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 079EC21E1BB for ; Wed, 11 Jul 2012 22:44:26 +0000 (UTC) From: Eric Wong On FreeBSD, writing to a loopback TCP socket does not guarantee immediate readability on the other end. Tested on Debian GNU/kFreeBSD 6.0 --- test/lib_read_write.rb | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/test/lib_read_write.rb b/test/lib_read_write.rb index 04d6fc6..586e826 100644 --- a/test/lib_read_write.rb +++ b/test/lib_read_write.rb @@ -242,6 +242,7 @@ module LibReadWriteTest def test_tryread_too_much assert_equal nil, @wr.kgio_trywrite("hi") + assert_equal @rd, @rd.kgio_wait_readable assert_equal "hi", @rd.kgio_tryread(4) end -- 1.7.2.5