Skip to content

A platform for community discussion. Free, open, simple.

DEV: attempt to de-flake concurrent spec (#34087)

Sam949645d19034
diff --git a/plugins/discourse-ai/spec/lib/completions/cancel_manager_spec.rb b/plugins/discourse-ai/spec/lib/completions/cancel_manager_spec.rb
index a1f53183135..432a06831ae 100644
--- a/plugins/discourse-ai/spec/lib/completions/cancel_manager_spec.rb
+++ b/plugins/discourse-ai/spec/lib/completions/cancel_manager_spec.rb
@@ -87,7 +87,9 @@ describe DiscourseAi::Completions::CancelManager do
wait_for { cancel_manager.callbacks.size == 1 }
cancel_manager.cancel!
- completion_thread.join(2)
+
+ # on slow machines this may take a bit longer to cancel, usually on a fast machine this is instant
+ completion_thread.join(5)
expect(completion_thread).not_to be_alive
ensure