From: "Shota Fukumori (sora_h)" Date: 2011-02-18T18:00:36+09:00 Subject: [ruby-core:35294] A patch for parallel test-all running (I sent a mail with Japanese to ruby-dev before. Please ignore this mail if you had same mail already; it's [ruby-dev:43222]) Hi, I started writing a patch about parallel running for test-all of ruby about 3 days ago. And I succeed running test-all parallel yesterday, I decide to send a mail to ruby-{dev,core} for reviewing. This mail is for reviewing patch, so I'll create a feature ticket if a patch behavior approached to my ideal. So, I'm waiting comments, reports for this patch. (I haven't checked any environments without mine, so I'm waiting for tester too. I wanna a report at Windows) ## The Patch Latest branch for development: https://github.com/sorah/ruby/compare/master...parallel_test Patch: https://gist.github.com/833420 I recommend to fetch git branch because it's latest. ## How to use 1. Apply patch or fetch https://github.com/sorah/ruby.git parallel_test branch. 2. Build 3. Run `make TESTS='-j2' test-all (N of -jN is count of jobs(workers), so you can specify -j4, -j8, -j16...) (--jobs-status puts statuses of workers.) (--jobs-status=replace works same, but more beautiful; using some escape sequences) ## Currently to-dos * It runs test-all completely, but some tests fail only with -jN. * It doesn't have any tests... :( * Anyone can write a test? ## FAQs Q. Why did you modify only `test/unit`? A. minitest/unit is an outside project, and I don't think minitest can run multiple test. Q. How does it work? A. I used `spawn` because windows doesn't support fork. Master process (It is kicked from `make` first) spawns `test/unit/parallel.rb` (=worker), and master communicate via STDIN/OUT. master <--------------------"ready" worker master "run path/to/test_*.rb..."-> worker master <---------------------"okay" worker master <----"p (minitest's output)" worker ... master <----"p (minitest's output)" worker master <-"done (marshalled result)" worker master <--------------------"ready" worker ...loop... Q. Doesn't work well at foobar platform A. I welcome a patch! :) Thanks, -- Shota Fukumori a.k.a. @sora_h - http://codnote.net/