From b90f4a46f55fbbcc001988ea4f8817295ccd0c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Thu, 27 Nov 2025 17:46:01 +0100 Subject: [PATCH] Resize execution context for spec with `CRYSTAL_WORKERS` --- src/spec.cr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/spec.cr b/src/spec.cr index adb806b4c841..fe9dd40d98ed 100644 --- a/src/spec.cr +++ b/src/spec.cr @@ -130,6 +130,12 @@ module Spec Process.on_terminate { abort! } {% end %} + {% if flag?(:execution_context) %} + if count = ENV["CRYSTAL_WORKERS"]?.try(&.to_i?) + Fiber::ExecutionContext.current.resize(count) + end + {% end %} + run end end