File tree Expand file tree Collapse file tree 5 files changed +17
-4
lines changed
test/async/container/notify Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def restart
149149 old_container &.stop ( @graceful_stop )
150150 end
151151
152- @notify &.ready!
152+ @notify &.ready! ( size : @container . size )
153153 ensure
154154 # If we are leaving this function with an exception, try to kill the container:
155155 container &.stop ( false )
@@ -185,7 +185,7 @@ def reload
185185
186186 # Enter the controller run loop, trapping `SIGINT` and `SIGTERM`.
187187 def run
188- @notify &.status! ( "Initializing..." )
188+ @notify &.status! ( "Initializing controller ..." )
189189
190190 with_signal_handlers do
191191 self . start
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ def initialize(**options)
5151 # @attribute [Group] The group of running children instances.
5252 attr :group
5353
54+ # @returns [Integer] The number of running children instances.
55+ def size
56+ @group . size
57+ end
58+
5459 # @attribute [Hash(Child, Hash)] The state of each child instance.
5560 attr :state
5661
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ def inspect
3232 # @attribute [Hash(IO, Fiber)] the running tasks, indexed by IO.
3333 attr :running
3434
35+ # @returns [Integer] The number of running processes.
36+ def size
37+ @running . size
38+ end
39+
3540 # Whether the group contains any running processes.
3641 # @returns [Boolean]
3742 def running?
Original file line number Diff line number Diff line change 1818
1919 lines = File . readlines ( notify_log ) . map { |line | JSON . parse ( line ) }
2020
21- expect ( lines . last ) . to be == { "ready" => true }
21+ expect ( lines . last ) . to have_keys (
22+ "ready" => be == true ,
23+ "size" => be > 0 ,
24+ )
2225 end
2326end
Original file line number Diff line number Diff line change 2424 container . sleep
2525
2626 _child , state = container . state . first
27- expect ( state ) . to be == { status : "Initializing..." }
27+ expect ( state ) . to be == { status : "Initializing controller ..." }
2828
2929 container . wait
3030
You can’t perform that action at this time.
0 commit comments