yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: yahns-public@yhbt.net
Subject: [PATCH] test: skip some buffering tests on non-default values
Date: Tue,  2 Aug 2016 21:43:40 +0000	[thread overview]
Message-ID: <20160802214340.27389-1-e@80x24.org> (raw)

It's too hard to reliably test output buffering behavior
with non-default values users sometimes set; so just skip
and warn about it for now.

ref: commit dad99b5ecd93cdf0a514ff9fb51d198f8aebb188
("test/test_proxy_pass: remove buffer size tuning")
---
 test/helper.rb                | 12 ++++++++++++
 test/test_output_buffering.rb |  1 +
 2 files changed, 13 insertions(+)

diff --git a/test/helper.rb b/test/helper.rb
index 73cde51..7b5c353 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -147,6 +147,18 @@ def close
   end
 end
 
+# tricky to test output buffering behavior across different OSes
+def skip_skb_mem
+  return if ENV['YAHNS_TEST_FORCE']
+  skip "linux-only test" unless RUBY_PLATFORM =~ /linux/
+  [ [ '/proc/sys/net/ipv4/tcp_rmem', "4096	87380	6291456\n" ],
+    ['/proc/sys/net/ipv4/tcp_wmem', "4096	16384	4194304\n" ]
+  ].each do |file, expect|
+    val = IO.read(file)
+    val == expect or skip "#{file} had: #{val}expected: #{expect}"
+  end
+end
+
 require 'yahns'
 
 # needed for parallel (MT) tests)
diff --git a/test/test_output_buffering.rb b/test/test_output_buffering.rb
index ba3e94a..e1a23b7 100644
--- a/test/test_output_buffering.rb
+++ b/test/test_output_buffering.rb
@@ -219,6 +219,7 @@ def gplv3.each
 
   def test_client_timeout
     err = @err
+    skip_skb_mem
     apperr = tmpfile(%w(app .err))
     cfg = Yahns::Config.new
     size = RAND.size * NR
-- 
EW


                 reply	other threads:[~2016-08-02 21:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160802214340.27389-1-e@80x24.org \
    --to=e@80x24.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).