yahns Ruby server user/dev discussion
 help / color / Atom feed
* [PATCH] test: skip some buffering tests on non-default values
@ 2016-08-02 21:43 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-08-02 21:43 UTC (permalink / raw)
  To: yahns-public

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 21:43 [PATCH] test: skip some buffering tests on non-default values Eric Wong

yahns Ruby server user/dev discussion

Archives are clonable:
	git clone --mirror https://yhbt.net/yahns-public
	git clone --mirror http://ou63pmih66umazou.onion/yahns-public

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns
	nntp://ou63pmih66umazou.onion/inbox.comp.lang.ruby.yahns

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox