We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52c08fc commit 1ca5143Copy full SHA for 1ca5143
spec/concurrent/promise_spec.rb
@@ -199,8 +199,10 @@ def get_ivar_from_args(opts)
199
context "when called on child after parent completes" do
200
let(:parent_promise) { Concurrent::Promise.execute { 1 + 1 }.tap { |p| p.wait } }
201
it 'sets state to :pending immediately' do
202
- child_promise = parent_promise.then { |two| two + 2 }.execute
+ latch = CountDownLatch.new
203
+ child_promise = parent_promise.then { |_| latch.wait }.execute
204
expect(child_promise.state).to eq(:pending)
205
+ latch.count_down
206
end
207
208
0 commit comments