From fc70d2e96306d519034ddde60769d3d789f8c2c5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 25 Oct 2009 23:34:26 -0700 Subject: tests: make large file memory tests more reliable Use a bigger random_blob and run GC before checking RSS --- t/GNUmakefile | 2 +- t/large-file-response.ru | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/t/GNUmakefile b/t/GNUmakefile index 4cfcfbf..e45d453 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -65,7 +65,7 @@ test-bin-$(RUBY_VERSION)/rainbows: ../bin/rainbows mv $@+ $@ random_blob: - dd if=/dev/urandom bs=1M count=10 of=$@+ + dd if=/dev/urandom bs=1M count=30 of=$@+ mv $@+ $@ $(T): random_blob diff --git a/t/large-file-response.ru b/t/large-file-response.ru index 90dc6c5..84163c1 100644 --- a/t/large-file-response.ru +++ b/t/large-file-response.ru @@ -4,6 +4,7 @@ use Rack::ContentType map "/rss" do run lambda { |env| # on Linux, this is in kilobytes + GC.start if GC.respond_to?(:start) ::File.read("/proc/self/status") =~ /^VmRSS:\s+(\d+)/ [ 200, {}, [ ($1.to_i * 1024).to_s ] ] } -- cgit v1.2.3-24-ge0c7