SlideShare una empresa de Scribd logo
1 de 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!

Más contenido relacionado

Similar a ruby test-all parallel running

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
 

Similar a ruby test-all parallel running (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
 

Más de Shota Fukumori

Más 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
 

Último

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 

Último (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

ruby test-all parallel running

Notas del editor

  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