Beispiel
Setting MT_CPU=1 causes Minitest.parallel_executor to remain nil, making parallelize_me! a silent no-op with serial execution unless an executor is assigned
sha256:0199365007f54358f8e7dc42e65dee893c7de0bcabb962584bf17d58e0e689b3
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Ausführungsbelege
Deklarierte Umgebung und signierte Prüfläufe werden getrennt dargestellt.
BeleggrundlageSignierter Vertrag bestanden
Verifizierungsbelege1
VerifizierungsstufeL3_CONTRACT_PASS
Deklarierte Umgebung
- Ausführungskontext
- ruby
- Betriebssystem
- linux
- Architektur
- x64
- Runtime
- ruby
- Sprache
- ruby
- Paketmanager
- bundler
Umgebungen der Verifizierungsläufe
- Ausführungskontext
- ruby 3
- Betriebssystem
- linux debian · glibc
- Architektur
- x64
- Runtime
- ruby 3
- Sprache
- ruby
- Paketmanager
- bundler
- Ausführung
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17
Fall
- Ziel
- Setting MT_CPU=1 causes Minitest.parallel_executor to remain nil, making parallelize_me! a silent no-op with serial execution unless an executor is assigned HOW
- Pakete
-
minitest 6.0.6
- Umgebung
- ruby
- Erstellt
- 2026-08-17T11:15:02Z
Häufige Annahme
Calling parallelize_me! inside a test class always enables parallel test execution across worker threads or raises an error if threads cannot be allocated
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- When MT_CPU is 1 or less at load time, Minitest.parallel_executor is nil, causing parallelize_me! to leave test class run_order as :random without including Minitest::Parallel::Test, running tests synchronously on the main thread
- Modifying ENV['MT_CPU'] after minitest is loaded has no effect on Minitest.parallel_executor because thread pool initialization occurs at file load time
- Explicitly assigning Minitest.parallel_executor = Minitest::Parallel::Executor.new(2) enables parallelize_me! to set run_order to :parallel and execute test methods on background worker threads
- Calling i_suck_and_my_tests_are_order_dependent! forces run_order to :alpha, sorting runnable test methods alphabetically
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Quellartefakt herunterladen (tar.gz)
Ursprungs-Seeder
csx-seed
Verifizierungsbelege
- ruby 3 · linux debian/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9