We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e105c0e commit 0ff700aCopy full SHA for 0ff700a
1 file changed
stackdriver-core/test/stackdriver/core/async_actor_test.rb
@@ -215,11 +215,20 @@ def start_thread &block
215
end
216
217
it "doesn't wait if timeout is 0" do
218
- actor.async_start
+ thread_running = false
219
+ actor.define_singleton_method :run_backgrounder do
220
+ loop { thread_running = true }
221
+ end
222
- actor.send :set_cleanup_options, timeout: 0
223
+ actor.async_start
224
225
+ wait_result = wait_until_true do
226
+ thread_running
227
228
+ wait_result.must_equal :completed
229
actor.async_stopped?.must_equal false
230
+
231
+ actor.send :set_cleanup_options, timeout: 0
232
stop = actor.async_stop!
233
stop.must_equal :forced
234
actor.async_stopped?.must_equal true
0 commit comments