SlideShare une entreprise Scribd logo
1  sur  42
Parallel running
`make test-all` of Ruby
      Shota Fukumori (sora_h)
Self Introduction

• Ruby Committer (I became by this patch!)
• Rubyist
• 8th grade student; (in Japan JHS 2nd)
• see http://sorah.cosmio.net/ or
  http://about.me/sorah
Agenda

• Background
• Implementation
• Result
• How to use
Background

• `make test-all` is slow
• Can’t run parallel
• I started writing a patch
Background


• Today I talk about between
Background
Background
• 4 days
Background


• 80% Project.
Windows
Windows


• In Windows, Ruby can’t use Kernel.fork
• Asked at IRC
Windows

sora_h: test-all
    Windows

(Will you reject a patch doesn’t support
Windows if I wrote a patch?)
Windows


unak:

(Yes I’ll reject.)
Windows

• ... It’ll be rejected if I don’t support Windows.
• So I used IO.popen
• but currently this feature doesn’t work at
  Windows. I’m working with it.
Traps in test
Trap?

• Doesn’t work well with parallel running
• Modify STDIN/OUT
• Duplicate filename/port number in 2+
  testcases
ruby/test_signal.rb

• def have_fork?; ... Process.fork{} ...; end
• test/unit at_exit, at_exit, at_exit
• Added flag for at_exit
ruby/test_process.rb


• Modifies STDIN/OUT
• duplicate and save backup in parallel.rb
net/http/test_https.rb
• Port number is same as net/http/test_http.rb
  --- a/test/net/http/test_https.rb
  +++ b/test/net/http/test_https.rb
  @@ -24,7 +24,7 @@ class TestNetHTTPS < Test::Unit::TestCase

      CONFIG = {
        'host' => '127.0.0.1',
  -     'port' => 10081,
  +     'port' => 10082,
        'proxy_host' => nil,
        'proxy_port' => nil,
        'ssl_enable' => true,
csv

• csv have duplicate temporary file name
  --- a/test/csv/test_serialization.rb
  +++ b/test/csv/test_serialization.rb
  @@ -131,7 +131,7 @@ class TestCSV::Serialization < TestCSV
      def test_io
       test_class_dump


  -    data_file = File.join(File.dirname(__FILE__), "temp_test_data.csv")
  +    data_file = File.join(File.dirname(__FILE__), "serialization_test_data.csv")
       CSV.dump(@names, File.open(data_file, "wb"))


       assert(File.exist?(data_file))
Implementation
Implementation
• http://github.com/sorah/ruby/blob/
  parallel_test
• patch on test/unit
• because minitest/unit is outer project
• and minitest/unit doesn’t support multiple
  file running?
How does it work
1. Load list of files.
2. Spawn workers.
3. Shift file from files and throw to worker
   which is ready while files isn’t empty
4. Retry testcase failed at worker in master
5. Output results.
How does it work
• Master: `make test-all`
  Worker: will be spawned by master process

                                 ruby parallel.rb
                      worker

 master    IO.popen     …

                      worker
How does it work
• Master: `make test-all`
  Worker: will be spawned by master process

        master




                            workers
How does it work
• Worker and Master are connected via
  STDIN,OUT = IO.pipe, IO.pipe


                    worker

 master     pipe      …

                    worker
How does it work
File List              I’m ready


                      Run test.rb
            master                   worker
                     Done <result>


                       I’m ready
How does it work
File List


test.rb        1 Fail   worker



              master    worker   Disk
                        ……

                        worker
How does it work
File List


               1 Fail   worker



              master
              test.rb   worker   Disk
                        ……

                        worker
How does it work
File List
                        test.rb
               1 Fail          worker



              master         worker     Disk
                              ……

                             worker
How does it work
File List

                        test.rb
               1 Fail   worker



              master    worker    Disk
                         ……

                        worker
How does it work
File List

                        test.rb
               1 Fail   worker



              master    worker    Disk
                         ……

                        worker
How does it work
File List

                        test.rb
               1 Fail   worker



              master    worker    Disk
                         ……

                        worker
Demo
Performance
                      TOTAL         TESTCASES       TESTS/S


150.0


112.5


 75.0


 37.5


   0
        no -j   -j1           -j2        -j3        -j5        -j8        -j13


                                       https://gist.github.com/834848 - thanks mrkn!
Performance
                             Fraction
               TOTAL         TESTCASES            TESTS/S
3.00

2.50

2.00

1.50

1.00

0.50

  0
       no -j   -j1     -j2       -j3        -j5         -j8    -j13

                                https://gist.github.com/834848 - thanks mrkn!
Discussion

• [ruby-dev:43222]
• [ruby-core:35294]
• #4415 [ruby-dev:43226]
• And I become a committer!
• Imported at r30939.
Testing


• Build ruby trunk (svn head)
• make TESTS=’-j N -v’ test-all
Testing

• If you found bug, please submit to
  http://redmine.ruby-lang.org/

  With assigning to “Shota Fukumori”.
• I’ll see and response to the ticket.
Todos
• Many bugs
• Windows
 • Anyone can test?
 • I can’t test on Win because Windows
    machine (MacBook)’s HDD is strange... ;’(
• Refactoring (I’m working)
Apology

• Thanks mrkn (Kenta Murata)
 • Providing Hints to me
 • Taking performance data
See Also

• http://www.slideshare.net/mrkn/ruby-
  workshop-sapporo16mrkn
• Ruby             - Kenta Murata a.k.a. mrkn

• (Japanese)
Thanks!

Contenu connexe

Similaire à Parallel running `make test-all` of Ruby

Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009pratiknaik
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled CucumbersJoseph Wilk
 
How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHiroshi SHIBATA
 
淺談Ruby process fork應用
淺談Ruby process fork應用淺談Ruby process fork應用
淺談Ruby process fork應用YC Ling
 
Disconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecordDisconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecordBen Mabey
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talkReuven Lerner
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
Intro to JavaScript Testing
Intro to JavaScript TestingIntro to JavaScript Testing
Intro to JavaScript TestingRan Mizrahi
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011tobiascrawley
 
Perl Testing Consideration (seen from other languages)
Perl Testing Consideration (seen from other languages)Perl Testing Consideration (seen from other languages)
Perl Testing Consideration (seen from other languages)Masaki Nakagawa
 
Testing is Fun @Confoo.ca 2012
Testing is Fun @Confoo.ca  2012Testing is Fun @Confoo.ca  2012
Testing is Fun @Confoo.ca 2012Gourav Tiwari
 
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Puppet
 
Test First Teaching
Test First TeachingTest First Teaching
Test First TeachingSarah Allen
 
Testing sync engine
Testing sync engineTesting sync engine
Testing sync engineIlya Puchka
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Hiroshi SHIBATA
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHiroshi SHIBATA
 
Parsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby TemplatesParsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby TemplatesJohn Hawthorn
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devopsRob Kinyon
 

Similaire à Parallel running `make test-all` of Ruby (20)

Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 
How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby Core
 
淺談Ruby process fork應用
淺談Ruby process fork應用淺談Ruby process fork應用
淺談Ruby process fork應用
 
Disconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecordDisconnecting the Database with ActiveRecord
Disconnecting the Database with ActiveRecord
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
Intro to JavaScript Testing
Intro to JavaScript TestingIntro to JavaScript Testing
Intro to JavaScript Testing
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
 
Perl Testing Consideration (seen from other languages)
Perl Testing Consideration (seen from other languages)Perl Testing Consideration (seen from other languages)
Perl Testing Consideration (seen from other languages)
 
Testing is Fun @Confoo.ca 2012
Testing is Fun @Confoo.ca  2012Testing is Fun @Confoo.ca  2012
Testing is Fun @Confoo.ca 2012
 
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
Testing for Ops: Going Beyond the Manifest - PuppetConf 2013
 
Test First Teaching
Test First TeachingTest First Teaching
Test First Teaching
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 
Testing sync engine
Testing sync engineTesting sync engine
Testing sync engine
 
Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0Gemification for Ruby 2.5/3.0
Gemification for Ruby 2.5/3.0
 
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby CoreHow to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
 
Parsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby TemplatesParsing and Rewriting Ruby Templates
Parsing and Rewriting Ruby Templates
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 

Plus de Shota Fukumori

Plus de Shota Fukumori (8)

3班 #spcamp amachang LT
3班 #spcamp amachang LT3班 #spcamp amachang LT
3班 #spcamp amachang LT
 
ぼくとわたしのVim
ぼくとわたしのVimぼくとわたしのVim
ぼくとわたしのVim
 
What is few?
What is few?What is few?
What is few?
 
Onsg11 iphone
Onsg11 iphoneOnsg11 iphone
Onsg11 iphone
 
Introduction to #pasratce
Introduction to #pasratceIntroduction to #pasratce
Introduction to #pasratce
 
Onsg10 Intro Termtter
Onsg10 Intro TermtterOnsg10 Intro Termtter
Onsg10 Intro Termtter
 
Online.sg #9 "LLVM" Opening & Closing
Online.sg #9 "LLVM" Opening & ClosingOnline.sg #9 "LLVM" Opening & Closing
Online.sg #9 "LLVM" Opening & Closing
 
Less to Few
Less to FewLess to Few
Less to Few
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Parallel running `make test-all` of Ruby

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n