File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# Released under the MIT License.
44# Copyright, 2026, by Samuel Williams.
55
6+ require "async/container/best"
67require "async/service/policy"
78require "async/container/statistics"
89
@@ -157,4 +158,21 @@ def success_status.success?; true; end
157158 expect ( statistics . failure_rate . window ) . to be == 60
158159 end
159160 end
161+
162+ with "concurrent failures" do
163+ it "only stops container once when multiple children fail simultaneously" do
164+ container = Async ::Container . best_container_class . new ( policy : policy )
165+ expect ( container ) . to receive ( :stop )
166+
167+ # Spawn 10 children that all fail immediately:
168+ 10 . times do |i |
169+ container . spawn ( name : "worker-#{ i } " ) do |instance |
170+ instance . ready!
171+ exit ( 1 )
172+ end
173+ end
174+
175+ container . wait
176+ end
177+ end
160178end
You can’t perform that action at this time.
0 commit comments