File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def setup(container)
1414 instance.ready!
1515
1616 # This is to avoid race conditions in the controller in test conditions.
17- sleep 0.1
17+ sleep 0.001
1818
1919 $stdout.write "."
2020
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def setup(container)
1414 instance.ready!
1515
1616 # This is to avoid race conditions in the controller in test conditions.
17- sleep 0.1
17+ sleep 0.001
1818
1919 clock = Async::Clock.start
2020
@@ -34,7 +34,7 @@ def setup(container)
3434 end
3535end
3636
37- controller = Graceful.new(graceful_stop: 1 )
37+ controller = Graceful.new(graceful_stop: 0.01 )
3838
3939begin
4040 controller.run
Original file line number Diff line number Diff line change @@ -18,18 +18,18 @@ def controller.setup(container)
1818 container.spawn(key: "test") do |instance|
1919 instance.ready!
2020
21- sleep(0.2 )
21+ sleep(0.02 )
2222
2323 @output.write(".")
2424 @output.flush
2525
26- sleep(0.4 )
26+ sleep(0.04 )
2727 end
2828
2929 container.spawn do |instance|
3030 instance.ready!
3131
32- sleep(0.3 )
32+ sleep(0.03 )
3333
3434 @output.write(",")
3535 @output.flush
@@ -64,7 +64,7 @@ def controller.setup(container)
6464 it "can spawn a reactor" do
6565 def controller.setup(container)
6666 container.async do |task|
67- task.sleep 1
67+ task.sleep 0.001
6868 end
6969 end
7070
@@ -123,7 +123,7 @@ def after(error = nil)
123123 expect(input.gets).to be == "Exiting...\n"
124124 exit_time = input.gets.to_f
125125
126- expect(exit_time - graceful_shutdown_time).to be >= 1.0
126+ expect(exit_time - graceful_shutdown_time).to be >= 0.01
127127 end
128128 end
129129
Original file line number Diff line number Diff line change 99class MyController < Async::Container::Controller
1010 def setup(container)
1111 container.run(restart: false) do |instance|
12- sleep(rand )
12+ sleep(0.001 )
1313
1414 instance.ready!
1515
16- sleep(rand )
16+ sleep(0.001 )
1717 end
1818 end
1919end
You can’t perform that action at this time.
0 commit comments