File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ class Worker < Processes::Poller
8
8
before_shutdown :run_stop_hooks
9
9
after_shutdown :run_exit_hooks
10
10
11
- attr_accessor :pool
12
-
13
11
attr_reader :worker_id , :queues
14
12
15
13
def initialize ( **options )
@@ -29,6 +27,8 @@ def metadata
29
27
end
30
28
31
29
private
30
+ attr_reader :pool
31
+
32
32
def poll
33
33
claim_executions . then do |executions |
34
34
executions . each do |execution |
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ class WorkerTest < ActiveSupport::TestCase
156
156
@worker . start
157
157
wait_for_registered_processes ( 1 , timeout : 1 . second )
158
158
159
- assert_not @worker . pool . shutdown?
159
+ assert_not @worker . instance_variable_get ( :@ pool) . shutdown?
160
160
161
161
process = SolidQueue ::Process . first
162
162
assert_equal "Worker" , process . kind
@@ -165,8 +165,8 @@ class WorkerTest < ActiveSupport::TestCase
165
165
166
166
# And now just wait until the worker tries to heartbeat and realises
167
167
# it needs to stop
168
- wait_while_with_timeout ( 2 ) { !@worker . pool . shutdown? }
169
- assert @worker . pool . shutdown?
168
+ wait_while_with_timeout ( 2 ) { !@worker . instance_variable_get ( :@ pool) . shutdown? }
169
+ assert @worker . instance_variable_get ( :@ pool) . shutdown?
170
170
ensure
171
171
SolidQueue . process_heartbeat_interval = old_heartbeat_interval
172
172
end
You can’t perform that action at this time.
0 commit comments