connection_pool 2.1.3 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
- require_relative 'helper'
1
+ require_relative "helper"
2
2
 
3
3
  class TestConnectionPoolTimedStack < Minitest::Test
4
-
5
4
  def setup
6
5
  @stack = ConnectionPool::TimedStack.new { Object.new }
7
6
  end
@@ -35,18 +34,18 @@ class TestConnectionPoolTimedStack < Minitest::Test
35
34
  end
36
35
 
37
36
  def test_object_creation_fails
38
- stack = ConnectionPool::TimedStack.new(2) { raise 'failure' }
37
+ stack = ConnectionPool::TimedStack.new(2) { raise "failure" }
39
38
 
40
39
  begin
41
40
  stack.pop
42
41
  rescue => error
43
- assert_equal 'failure', error.message
42
+ assert_equal "failure", error.message
44
43
  end
45
44
 
46
45
  begin
47
46
  stack.pop
48
47
  rescue => error
49
- assert_equal 'failure', error.message
48
+ assert_equal "failure", error.message
50
49
  end
51
50
 
52
51
  refute_empty stack
@@ -63,19 +62,13 @@ class TestConnectionPoolTimedStack < Minitest::Test
63
62
  end
64
63
 
65
64
  def test_pop_empty
66
- e = assert_raises Timeout::Error do
67
- @stack.pop timeout: 0
68
- end
69
-
70
- assert_equal 'Waited 0 sec', e.message
65
+ e = assert_raises(ConnectionPool::TimeoutError) { @stack.pop timeout: 0 }
66
+ assert_equal "Waited 0 sec", e.message
71
67
  end
72
68
 
73
69
  def test_pop_empty_2_0_compatibility
74
- e = assert_raises Timeout::Error do
75
- @stack.pop 0
76
- end
77
-
78
- assert_equal 'Waited 0 sec', e.message
70
+ e = assert_raises(Timeout::Error) { @stack.pop 0 }
71
+ assert_equal "Waited 0 sec", e.message
79
72
  end
80
73
 
81
74
  def test_pop_full
@@ -88,11 +81,11 @@ class TestConnectionPoolTimedStack < Minitest::Test
88
81
  end
89
82
 
90
83
  def test_pop_wait
91
- thread = Thread.start do
84
+ thread = Thread.start {
92
85
  @stack.pop
93
- end
86
+ }
94
87
 
95
- Thread.pass while thread.status == 'run'
88
+ Thread.pass while thread.status == "run"
96
89
 
97
90
  object = Object.new
98
91
 
@@ -102,13 +95,23 @@ class TestConnectionPoolTimedStack < Minitest::Test
102
95
  end
103
96
 
104
97
  def test_pop_shutdown
105
- @stack.shutdown { }
98
+ @stack.shutdown {}
106
99
 
107
100
  assert_raises ConnectionPool::PoolShuttingDownError do
108
101
  @stack.pop
109
102
  end
110
103
  end
111
104
 
105
+ def test_pop_shutdown_reload
106
+ stack = ConnectionPool::TimedStack.new(1) { Object.new }
107
+ object = stack.pop
108
+ stack.push(object)
109
+
110
+ stack.shutdown(reload: true) {}
111
+
112
+ refute_equal object, stack.pop
113
+ end
114
+
112
115
  def test_push
113
116
  stack = ConnectionPool::TimedStack.new(1) { Object.new }
114
117
 
@@ -144,6 +147,4 @@ class TestConnectionPoolTimedStack < Minitest::Test
144
147
  refute_empty called
145
148
  assert_empty @stack
146
149
  end
147
-
148
150
  end
149
-
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connection_pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Perham
8
8
  - Damian Janowski
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-19 00:00:00.000000000 Z
12
+ date: 2021-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -61,8 +61,8 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
+ - ".github/workflows/ci.yml"
64
65
  - ".gitignore"
65
- - ".travis.yml"
66
66
  - Changes.md
67
67
  - Gemfile
68
68
  - LICENSE
@@ -72,6 +72,7 @@ files:
72
72
  - lib/connection_pool.rb
73
73
  - lib/connection_pool/timed_stack.rb
74
74
  - lib/connection_pool/version.rb
75
+ - lib/connection_pool/wrapper.rb
75
76
  - test/helper.rb
76
77
  - test/test_connection_pool.rb
77
78
  - test/test_connection_pool_timed_stack.rb
@@ -79,7 +80,7 @@ homepage: https://github.com/mperham/connection_pool
79
80
  licenses:
80
81
  - MIT
81
82
  metadata: {}
82
- post_install_message:
83
+ post_install_message:
83
84
  rdoc_options: []
84
85
  require_paths:
85
86
  - lib
@@ -87,16 +88,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
88
  requirements:
88
89
  - - ">="
89
90
  - !ruby/object:Gem::Version
90
- version: '0'
91
+ version: 2.2.0
91
92
  required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  requirements:
93
94
  - - ">="
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.4.5
99
- signing_key:
98
+ rubygems_version: 3.2.3
99
+ signing_key:
100
100
  specification_version: 4
101
101
  summary: Generic connection pool for Ruby
102
102
  test_files:
data/.travis.yml DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- sudo: false
3
- cache: bundler
4
- language: ruby
5
- rvm:
6
- - 1.9.3
7
- - 2.0.0
8
- - 2.1.0
9
- - 2.2.0
10
- - jruby
11
- - rbx-2
12
- notifications:
13
- email:
14
- - drbrain@segment7.net