diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-05 06:09:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-05 06:09:17 +0000 |
commit | 8d66627161fab5cc65dfb702e3285eb4fef221e8 (patch) | |
tree | cc872fd6ae0ab0fa471a293a9dfb7706d226f883 /test/webrick | |
parent | b01c28eeb3942bce1ddf9b9243ecf727d5421c6d (diff) | |
download | ruby-8d66627161fab5cc65dfb702e3285eb4fef221e8.tar.gz |
leakchecker.rb: remove temporary measure
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher):
make watcher thread restartable.
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate):
new method to terminate watcher thread.
* test/lib/leakchecker.rb (LeakChecker#find_threads): revert
r46941.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick')
-rw-r--r-- | test/webrick/test_cgi.rb | 5 | ||||
-rw-r--r-- | test/webrick/test_filehandler.rb | 5 | ||||
-rw-r--r-- | test/webrick/test_httpauth.rb | 5 | ||||
-rw-r--r-- | test/webrick/test_httpproxy.rb | 5 | ||||
-rw-r--r-- | test/webrick/test_httprequest.rb | 5 | ||||
-rw-r--r-- | test/webrick/test_httpserver.rb | 5 | ||||
-rw-r--r-- | test/webrick/test_utils.rb | 5 |
7 files changed, 35 insertions, 0 deletions
diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb index 090286840b..9dd6be8155 100644 --- a/test/webrick/test_cgi.rb +++ b/test/webrick/test_cgi.rb @@ -7,6 +7,11 @@ require "test/unit" class TestWEBrickCGI < Test::Unit::TestCase CRLF = "\r\n" + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def start_cgi_server(log_tester=TestWEBrick::DefaultLogTester, &block) config = { :CGIInterpreter => TestWEBrick::RubyBin, diff --git a/test/webrick/test_filehandler.rb b/test/webrick/test_filehandler.rb index 663b237a82..0e05c6824c 100644 --- a/test/webrick/test_filehandler.rb +++ b/test/webrick/test_filehandler.rb @@ -5,6 +5,11 @@ require "webrick" require "stringio" class WEBrick::TestFileHandler < Test::Unit::TestCase + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def default_file_handler(filename) klass = WEBrick::HTTPServlet::DefaultFileHandler klass.new(WEBrick::Config::HTTP, filename) diff --git a/test/webrick/test_httpauth.rb b/test/webrick/test_httpauth.rb index 4376b91842..126bc6ee54 100644 --- a/test/webrick/test_httpauth.rb +++ b/test/webrick/test_httpauth.rb @@ -7,6 +7,11 @@ require "webrick/httpauth/basicauth" require_relative "utils" class TestWEBrickHTTPAuth < Test::Unit::TestCase + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def test_basic_auth log_tester = lambda {|log, access_log| assert_equal(1, log.length) diff --git a/test/webrick/test_httpproxy.rb b/test/webrick/test_httpproxy.rb index 6837f0c738..335d442fbb 100644 --- a/test/webrick/test_httpproxy.rb +++ b/test/webrick/test_httpproxy.rb @@ -13,6 +13,11 @@ end require File.expand_path("utils.rb", File.dirname(__FILE__)) class TestWEBrickHTTPProxy < Test::Unit::TestCase + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def test_fake_proxy assert_nil(WEBrick::FakeProxyURI.scheme) assert_nil(WEBrick::FakeProxyURI.host) diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb index 45d26f8699..3ece8a3ad9 100644 --- a/test/webrick/test_httprequest.rb +++ b/test/webrick/test_httprequest.rb @@ -4,6 +4,11 @@ require "stringio" require "test/unit" class TestWEBrickHTTPRequest < Test::Unit::TestCase + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def test_simple_request msg = <<-_end_of_message_ GET / diff --git a/test/webrick/test_httpserver.rb b/test/webrick/test_httpserver.rb index 5adf617fa5..5aa94637ba 100644 --- a/test/webrick/test_httpserver.rb +++ b/test/webrick/test_httpserver.rb @@ -12,6 +12,11 @@ class TestWEBrickHTTPServer < Test::Unit::TestCase end NoLog = WEBrick::Log.new(empty_log, WEBrick::BasicLog::WARN) + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def test_mount httpd = WEBrick::HTTPServer.new( :Logger => NoLog, diff --git a/test/webrick/test_utils.rb b/test/webrick/test_utils.rb index 23996de5d2..c34ba8bb73 100644 --- a/test/webrick/test_utils.rb +++ b/test/webrick/test_utils.rb @@ -3,6 +3,11 @@ require "test/unit" require "webrick/utils" class TestWEBrickUtils < Test::Unit::TestCase + def teardown + WEBrick::Utils::TimeoutHandler.terminate + super + end + def assert_expired(m) Thread.handle_interrupt(Timeout::Error => :never, EX => :never) do assert_empty(m::TimeoutHandler.instance.instance_variable_get(:@timeout_info)) |