File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 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
88 before_shutdown :run_stop_hooks
99 after_shutdown :run_exit_hooks
1010
11- attr_accessor :pool
12-
1311 attr_reader :worker_id , :queues
1412
1513 def initialize ( **options )
@@ -29,6 +27,8 @@ def metadata
2927 end
3028
3129 private
30+ attr_reader :pool
31+
3232 def poll
3333 claim_executions . then do |executions |
3434 executions . each do |execution |
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ class WorkerTest < ActiveSupport::TestCase
156156 @worker . start
157157 wait_for_registered_processes ( 1 , timeout : 1 . second )
158158
159- assert_not @worker . pool . shutdown?
159+ assert_not @worker . instance_variable_get ( :@ pool) . shutdown?
160160
161161 process = SolidQueue ::Process . first
162162 assert_equal "Worker" , process . kind
@@ -165,8 +165,8 @@ class WorkerTest < ActiveSupport::TestCase
165165
166166 # And now just wait until the worker tries to heartbeat and realises
167167 # 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?
170170 ensure
171171 SolidQueue . process_heartbeat_interval = old_heartbeat_interval
172172 end
You can’t perform that action at this time.
0 commit comments