Skip to content

Commit 6a470cf

Browse files
committed
Updated brittle specs for Supervisor restart strategies.
1 parent d1a5954 commit 6a470cf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

spec/concurrent/supervisor_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -832,8 +832,8 @@ def mock_thread(status = 'run')
832832
monitor_interval: 0.1)
833833
supervisor.add_worker(error_class.new)
834834
supervisor.should_receive(:exceeded_max_restart_frequency?).once.and_return(true)
835-
supervisor.run!
836-
sleep(0.2)
835+
future = Concurrent::Future.execute{ supervisor.run }
836+
future.value(1)
837837
supervisor.should_not be_running
838838
end
839839

@@ -842,8 +842,8 @@ def mock_thread(status = 'run')
842842
monitor_interval: 0.1)
843843
supervisor.add_worker(error_class.new)
844844
supervisor.should_receive(:exceeded_max_restart_frequency?).once.and_return(true)
845-
supervisor.run!
846-
sleep(0.2)
845+
future = Concurrent::Future.execute{ supervisor.run }
846+
future.value(1)
847847
supervisor.should_not be_running
848848
end
849849

@@ -852,8 +852,8 @@ def mock_thread(status = 'run')
852852
monitor_interval: 0.1)
853853
supervisor.add_worker(error_class.new)
854854
supervisor.should_receive(:exceeded_max_restart_frequency?).once.and_return(true)
855-
supervisor.run!
856-
sleep(0.2)
855+
future = Concurrent::Future.execute{ supervisor.run }
856+
future.value(1)
857857
supervisor.should_not be_running
858858
end
859859
end

0 commit comments

Comments
 (0)