yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] test: skip some buffering tests on non-default values
@ 2016-08-02 21:43  4% Eric Wong
  0 siblings, 0 replies; 2+ results
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 related	[relevance 4%]

* [PATCH] test/test_proxy_pass: remove buffer size tuning
@ 2015-04-07  8:08  7% Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-04-07  8:08 UTC (permalink / raw)
  To: yahns-public

On one of my ancient, cache-starved home systems, this tends to
cause pathologically bad performance during some of these tests.
---
 test/test_proxy_pass.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/test_proxy_pass.rb b/test/test_proxy_pass.rb
index c1539f8..f5ae12f 100644
--- a/test/test_proxy_pass.rb
+++ b/test/test_proxy_pass.rb
@@ -210,7 +210,7 @@ class TestProxyPass < Testcase
       @srv2.close
       cfg.instance_eval do
         app(:rack, Yahns::ProxyPass.new("http://#{host2}:#{port2}")) do
-          listen "#{host}:#{port}", sndbuf: 16384
+          listen "#{host}:#{port}"
           client_max_body_size nil
         end
         stderr_path err.path
@@ -221,7 +221,7 @@ class TestProxyPass < Testcase
       @srv.close
       cfg.instance_eval do
         app(:rack, ProxiedApp.new) do
-          listen "#{host2}:#{port2}", rcvbuf: 4096
+          listen "#{host2}:#{port2}"
           client_max_body_size nil
         end
         stderr_path err.path
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-04-07  8:08  7% [PATCH] test/test_proxy_pass: remove buffer size tuning Eric Wong
2016-08-02 21:43  4% [PATCH] test: skip some buffering tests on non-default values Eric Wong

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).