Wednesday, July 1, 2009

Run your junit tests in parallel (with spring 3.0 and maven)

Swimming in a sea of patches...

Note; Most of the content in this post has been surpassed by a newer entry.

If you're willing to apply a few patches, you can now run your junit tests in parallel. There are two main use-cases for this; one is to make your regular unit tests run faster, the other is for io-bound tests, where you want to run several in parallel because you're waiting for external systems.

Just to whet your appetite, here are some numbers from a testcase (running 1000 instances of a simple unit-test-class):

SC = SingleThreadedComputer (Computer, Junit47-snapshot class)
PC = ParallelComputer (ParallelComputer, Junit4.7-snapshot class)
CPC = ConfigurableParallelComputer (My project, see references)
C=Classes (one thread per class)
M=Methods (one thread per method)

Core 2 duo 3.14GhzIntel i7 920
PC(Classes, Method, Unlimited threads)406806
CPC(Methods,16 threads)218214
CPC(Classes, Unlimited threads)203116
CPC(Classes,Methods, Unlimited threads)266147

Running time in ms, 1000 simple tests

The table shows that for most dual-core solutions, running with parallel threads is currently never any faster than running non-threaded. Switching to the brand-new Intel i7 (4 hyperthreaded cores) has a marked effect, where simple unit test performance is doubled.

The lack of punch does, of course, change the moment your tests start doing IO (Integration tests, selenium tests and other web-tests).

The juicy stuff
svn co

Second build with mvn clean install: 102 seconds.
With 80 threads class-parallel on the i7: 37 seconds.

Class-parallel works easily on most tests.

A sea of patches

Getting all of this to work was not without its problems, though. To get this running, I had to patch just about half the libraries in use in my current stack. Furthermore, there's a huge difference between getting it to run and getting it to run without hiccups - every time. These patches insure that your infrastructure works as it should, but are your tests concurrent ?

Patches involved

See below for how to apply these patches in a simple manner.
Spring (3.0 trunk):
AspectJ: Patch trunk with this patch (if using spring) (This patch is included in version 1.6.6)
Several patches needed for thread safety:
Maven: You need a patched version of surefire that supports junit 4.7:
You'll also probably want to be using the ConfigurableParallelComputer instead of the ParallelComputer that's included with JUnit.

With these patches in place you're smooth sailing ;)

Applying the patches

Note: If you did this on the pre rc1 version of this patchset, I recommend that you start from a fresh copy of everything this time.
If you're using maven you could try this sequence:

git clone git://
git clone git://
git clone git://
git clone git://
git clone git://
cd junit
cd ../spring-framework-concurrent-junit-patch
cd ../spring-test
mvn install
cd ../configurable-parallel-computer
mvn install
cd ../spring-framework-concurrent-junit-patch

cd ../spring-concurrency-test
mvn install # Test project to verify that everything is ok

Your new versions

JUnit should be modified to 4.7-CONCURRENT
spring-test should have version number 3.0.0.RC1-CONCURRENT
Surefire should be modified to 2.5-SNAPSHOT
You must update your aspectj version to 1.6.6 in your project. Spring does a transitive
include on 1.6.5

You can see the version number for the spring artifacts when building spring. Probably something like 3.0.0.BUILD-20091005102426

Maven surefire settings


UnlimitedThreads knocks out threadCount and perCoreThreadCount.

Look at the various "install" scripts to see the version numbers of the artifacts.
Simple, eh ?

And while we're at it: Half of the work with patching these projects has been about fighting with version control systems and custom made build scripts. So please; switch to GIT and maven: I can build any maven project without reading as much as a readme file. Maven allows me as a casual bystander to *easily* make contributions; I never need to read that 4 page "how to build" manual! Git is the only version control tool that respects my right/duty to patch, change and upgrade other projects. It allows me to do all these things without having to *ask* anyone. Repeat after me: Git and maven encourages free collaboration; a key idea of open source, right ?


  1. i have go through your article and bit eager to know what will need to use ANT instead of Maven. share some screenshots also if possible
    for selenium hands on practice Best selenium training institute in chennai

  2. Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.

    machine learning training in chennai
    machine learning course in Chennai
    machine learning training center in chennai
    best training insitute for machine learning
    Android training in Chennai
    PMP training in chennai

  3. Thank you so much for your information,its very useful and helful to me.Keep updating and sharing. Thank you.
    RPA training in chennai | UiPath training in chennai


  4. After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
    Thank you to the perform as well as discuss anything incredibly important in my opinion. We loose time waiting for your next article writing in addition to I beg one to get back to pay a visit to our website in

    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training


  5. Get the most advanced RPA Course by RPA Professional expert. Just attend a FREE Demo session about how the RPA Tools get work.
    For further details call us @ 9884412301 | 9600112302

    RPA training in chennai | RPA training in chennai

  6. The article is so informative. This is more helpful for our
    software testing training online
    best selenium online training in chennai. Thanks for sharing


  7. Just seen your Article, it amazed me and surpised me with god thoughts that eveyone will benefit from it. It is really a very informative post for all those budding entreprenuers planning to take advantage of post for business expansions. You always share such a wonderful articlewhich helps us to gain knowledge .Thanks for sharing such a wonderful article, It will be deinitely helpful and fruitful article.

  8. Great. It is good to constantly coming up with creative ideas. Provides much needed knowledge. goal oriented blog posts and always tried to find creative ways to meet goals.

    Online affiliates

  9. Your post is very good. I got to learn a lot from your post. Thank you for sharing your article for us. it is amazing post
    what is seo
    types of seo

  10. This is a fantastic idea! I like it a lot because it's super easy for the audience to see the value of opting in. wonderful and amazing post very use full your post thanks for sharing your article
    Android Application development
    Web application

  11. If you want best smart phones under 10000-15000 then go on.

  12. If you want best home theater under 5000-10000 then go on.

  13. If you want best bluetooth speakers with affordable price rate then go on

  14. If you are looking for sony bluetooth speakers then go on

  15. If you are looking for Best Gyms in Ghaziabad then click on the given link.

  16. While composing the last paper of your last B.Com test, a plenty of considerations experience your psyche. A great deal of these contemplations incorporate plans about resting for a whole week or celebrating for a whole week, contingent upon your individual inclinations. Be that as it may, trust us, none of that is really going to happen in light of the fact that when you complete your tests your folks, relatives, neighbours, and even your Facebook companions will begin getting some information about your feasible arrangements. What's more, don't mistake them for your gathering or dozing plans since they are alluding to your vocation Career after B com plans. In the present focused world, you are offered with many profession improving courses. On the off chance that you are not happy with the profession or course you decided for yourself at that point there are some present moment yet high worth – low speculation courses accessible in the market.

  17. Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agianMarriage certificate in delhi
    Marriage certificate in ghaziabad
    Marriage registration in gurgaon
    Marriage registration in noida
    special marriage act
    Marriage certificate online
    Marriage certificate in mumbai
    Marriage certificate in faridabad
    Marriage certificate in bangalore
    Marriage certificate in hyderabad thanks once again to all.

  18. Nice Post
    For Data Science training in Bangalore, Visit:
    Data Science training in Bangalore

  19. Soma pill is very effective as a painkiller that helps us to get effective relief from pain. This cannot cure pain. Yet when it is taken with proper rest, it can offer you effective relief from pain.
    This painkiller can offer you relief from any kind of pain. But Soma 350 mg is best in treating acute pain. Acute pain is a type of short-term pain which is sharp in nature. Buy Soma 350 mg online to get relief from your acute pain.

    Buy Soma 350 mg
    Soma Pill
    Buy Soma 350 mg online

    Buy Soma 350 mg online
    Soma Pill
    Buy Soma 350 mg

  20. Thanks for sharing it.I got Very valuable information from your blog.your post is really very Informatve. I got Very valuable information from your blog.I’m satisfied with the information that you provide for me.

    Python Training in Pune
    Python Classes
    Python Placement
    Python Institute Pune
    Python courses

  21. The part I find interesting is the more or less complete separation of comments here, keep it up for more update about this related blog. Visit OGEN Infosystem for creative and responsive Website Designing and also for SEO and PPC Services.
    Website Designing Company

  22. this blog is very helpfull and contain good knowledge
    also visit my website for music
    Tum Hi Aana From Marjaavaan Song

  23. this article is very infomartive and helpfull
    also visit my website for songs
    Tum Hi Aana From Marjaavaan Song

  24. These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post.selenium training in bangalore

  25. Appslure is Best app development company in mumbai and you can get website development service at a very affordable price.
    App development company in mumbai

  26. I am a regular reader of your blog and I find it really informative. Hope more Articles From You.Best Tableau tutorial videos with Real time scenarios . hope more articles from you.

  27. Like HostGator, they would also offer you with free migration from your old server to the new server. They also provide free SSL certificates on all the sites hosted on their servers. This Black Friday Web Hosting Deals 2019, they are offering a 60 % discount on shared hosting. On the other hand, you can avail 50% discount on various VPS solutions.

  28. It’s really great information for becoming a better Blogger. Keep sharing, Thanks...

    Bangalore Training Academy located in BTM - Bangalore, Best Informatica Training in Bangalore with expert real-time trainers who are working Professionals with min 8 + years of experience in Informatica Industry, we also provide 100% Placement Assistance with Live Projects on Informatica.

  29. Thanks, You for such a great post. I have tried and found it really helpful.

    Best Hadoop Training in Bangalore, offered by BangaloreTrainingAcademy. Bangalore's No.1 Hadoop Training Institute. Classroom, Online and Corporate training.

    Thanks and Regards,

  30. Thank you so much for the great and very beneficial stuff that you have shared with the world.

    Become an Expert In Python Training! The most trusted and trending Programming Language. Learn from experienced Trainers and get the knowledge to crack a coding interview, @Softgen Infotech Located in BTM Layout.

  31. Really very happy to say, your post is very interesting to read. I never stop myself to say something about it. You’re doing a great job. Keep it up...

    Upgrade your career Learn AWS Training from industry experts get Complete hands-on Training, Interview preparation, and Job Assistance at Softgen Infotech Located in BTM Layout.

  32. Enjoyed reading the article above, really explains everything in detail,the article is very interesting and effective.Thank you and good luck…

    Start your journey with DevOps Course and get hands-on Experience with 100% Placement assistance from experts Trainers @Softgen Infotech Located in BTM Layout Bangalore.

  33. I am really happy to say it’s an interesting post to read. I learn new information from your article, you are doing a great job. Keep it up…

    Are you looking for Best Training Institute for Data Warehousing Training center in BTM? Bangalore Training Academy Training provides Data Warehousing course, live project with job placement by experienced faculties.

  34. Thanks a lot for sharing it, that’s truly has added a lot to our knowledge about this topic. Have a more success ful day. Amazing write-up, always find something interesting and here i want to share some thing about mulesoft training online .

  35. I am really happy to say it’s an interesting post to read. I learn new information from your article, you are doing a great job. Keep it up…

    Real Time Experts offers the Best SAP SCM Training in Bangalore - Marathahalli, We offer Real-Time Training with Live Projects, Our SAP SCM Trainers are Working Professionals with 8+ years of Expertise in SAP SCM, we also provide placement assistance.

  36. I have to agree with all your inclusions such great information that will be very useful, Thank you for sharing this great blog.
    Events Planner In Delhi
    Wedding Planner In Delhi
    Download Free Newspaper WordPress Theme
    Download Yoast SEO Premium WordPress Plugin

  37. I read this post your post so nice and very informative post thanks for sharing this post...

    Enrol in SAP FICO Training in Bangalore to master configurations of H SAP FICO with eTechno Soft Solutions Located in BTM Layout.

  38. Jeewangarg is a Leading Digital Marketing Company which is helping your brand to cut through the Digital Clutter with its best SEO Company in Delhi. Our range of Services includes SEO Services, PPC Company in Delhi, Website Designing Services and Social Media Marketing Services. Being a Google Partner in India, we provide our client with 100% satisfaction in every aspect of their marketing goals. So, what are you waiting for Connect to the team of best SEO Expert in India, Google Ads Experts, Website Designing Experts, Social Media Experts & more to boost your Digital Presence today with the high quality Digital Marketing Services.

  39. Thanks for your excellent blog and giving great kind of information. So useful. Nice work keep it up thanks for sharing the knowledge.
    Visit us
    Click Here
    For More Details
    Visit Website
    See More

  40. TVH, Best Video & Film Production Houses/Company in Delhi Ncr. we Provides Corporate Films, Documentary Films, Short Makers, Explainer Videos, & promotional video services in delhi ncr. Call us @ 8178662477. Best Video & Film Production Houses/company in Delhi NCR Visit Us: film production companies in india, corporate video production company

  41. I am a regular reader of your blog and I find it really informative. Hope more Articles From You.Best
    Tableau Training Videos available Here.

  42. The development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. Machine Learning Final Year Projects In case you will succeed, you have to begin building machine learning projects in the near future.

    Projects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.

    Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.

  43. I am really impressed with your blog article, such great & useful knowledge you mentioned here. Your post is very informative. Also check out the best web development company in Kolkata | web hosting company in Kolkata | best hotel management colleges in Kolkata

  44. Wonderful thanks for sharing an amazing idea. keep it...

    Start your journey with RPA Training in Bangalore and get hands-on Experience with 100% Placement assistance from experts Trainers @Softgen Infotech Located in BTM Layout Bangalore. Expert Trainers with 8+ Years of experience, Free Demo Classes Conducted.

  45. Arrow Aircraft is one of the reliable private jet india. We offer Aircraft Charter Services in Delhi, Mumbai as well as all over the World.

    Kedarnath Yatra by Helicopter
    Chardham Yatra by Helicopter
    Book Helicopter for Wedding Price

  46. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing.. i Want to share Some data regarding the websphere tutorial with free bundle videos is provided.

  47. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    angular js online training

  48. We as a team of real-time industrial experience with a lot of knowledge in developing applications in python programming (7+ years) will ensure that we will deliver our best in python training in vijayawada. , and we believe that no one matches us in this context.

  49. This comment has been removed by the author.

  50. Snapdeal Winner List 2020 here came up with an Offer where you can win Snapdeal prize list by just playing a game & win prizes.
    Snapdeal winner name also check the Snapdeal lucky draw

  51. Thanks for posting such an useful and informative stuff...

    Learn Tableau Online


  52. Thank you for sharing such a great information.Its really nice and informative.hope more posts from you. I also want to share some information recently i have gone through and i had find the one of the best mulesoft training videos


  53. I am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up and a i also want to share some information regarding selenium course and selenium training videos

  54. Download your favorite Latest Mp3 Lyrics which are available in English, Hindi, Bangla, Telugu, Latin, Arabic, Russian, etc.

    Click Here

    Click Here

    Click Here

    Click Here

    Click Here

  55. This comment has been removed by the author.

  56. Well I definitely enjoyed reading it. This tip procured by you is very constructive for correct planning.

    event management companies
    event management companies in delhi

  57. snapdeal here thought of an Offer where you can win exceptional snapdeal prize by simply playing a game and win prizes Call @7596886123"
    Snapdeal winner 2020
    Snapdeal lucky draw tatasafari 2020
    Snapdeal lucky winner list 2020
    Snapdeal lucky draw 2020


  58. Class College Education training Beauty teaching university academy lesson teacher master student spa manager skin care learn eyelash extensions tattoo spray


  59. We as a team of real-time industrial experience with a lot of knowledge in developing applications in python programming (7+ years) will ensure that we will deliver our best in python training in vijayawada. , and we believe that no one matches us in this context.

  60. Snapdeal winner list here an offer you can win the Snapdeal lucky draw.Here you can win the Snapdeal winner list 2020 and Snapdeal winner list. Snapdeal lucky draw where you can win the prize just playing the game.You can also check Snapdeal winner name and Snapdeal winner name 2020

  61. click here for more info.

  62. Thanks for provide great informatic and looking beautiful blog, really nice required information & the things i never imagined and i would request, wright more blog and blog post like that for us. Thanks you once agian

    court marriage in delhi ncr
    court marriage in delhi
    court marriage in noida
    court marriage in ghaziabad
    court marriage in gurgaon
    court marriage in faridabad
    court marriage in greater noida
    name change online
    court marriage in chandigarh
    court marriage in bangalore

  63. I'm very pleased to uncover this web site. I want to to thank you for your time due to this fantastic read!! I definitely loved every little bit of it and i also have you bookmarked to look at new information in your site.
    Tech news

  64. "I have website Live Digital india for Related to Movies Entertenmaint so please visit my site
    Download Movies



  65. Thanks for sharing such a wonderful blog on Amazon Web Services .
    This blog contains so much data about Amazon Web Services ,like if anyone who is searching for the Amazon Web Services data,They will easily grab the knowledge from this .Requested you to please keep sharing these type of useful content so that other can get benefit from your shared content.
    Thanks and Regards,
    Amazon Web Services training in Chennai
    Best Amazon Web Services training in chennai
    Top Amazon Web Services Training in chennai
    Amazon Web Services training fees in Velachery,Chennai

  66. Awesome blog I enjoyed reading your articles. This is really informative post.
    I am also sharing some nice stuff to you guys please go through it and take a review.
    software developer
    software developer in india
    software developers
    hire a virtual assistant
    vitual assistant
    hiring a virtual assistant
    hiring virtual assistants


  67. Thanks for sharing such a great information.It is really one of the finest article and more informative too. I want to share some informative data about .net training and c# training . Expecting more articles from you .

  68. Shopclues lucky draw 2020| Shopclues winner 2020|Get to Know Shopclues Lucky Draw Winner 2020. Call Shopclues Helpline Phone Number+91-9835565523 for Shopclues Online Shopping Lucky Draw.
    Shopclues online lucky draw winner
    Shopclues winner 2020
    shopclues car lucky draw

  69. Great efforts put to publish these kinds of articles that are very useful to know. I’m thoroughly enjoying your blog. And Good comments create great relations. You’re doing an excellent job. Keep it up.

    Magento Development Training Course in Chennai Zuan Education

    Selenium Training Course in Chennai Zuan Education

  70. Poker online situs terbaik yang kini dapat dimainkan seperti Bandar Poker yang menyediakan beberapa situs lainnya seperti , kemudian,, dan yang paling akhir yaitu Jangan lupa mendaftar di panenqq silakan dicoba ya boss

  71. I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about sap bi tutorial for beginners it and I love learning more about this topic.

  72. Snapdeal winner 2020 | Dear customer, you can complain here If you get to call and SMS regarding Snapdeal lucky draw, Mahindra xuv 500, lucky draw contest, contact us at to know the actual Snapdeal prize winners 2020.
    Snapdeal winner 2020
    Snapdeal lucky draw winner 2020
    Snapdeal lucky draw contest 2020
    snapdeal winner prizes 2020

  73. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better. The post is written in very a good manner and it contains many useful information for me. Thank you very much and will look for more postings from you.

    digital marketing blog
    digital marketing bloggers
    digital marketing blogs
    digital marketing blogs in india
    digital marketing blog 2020
    digital marketing blog sites
    skartec's digital marketing blog
    skartec's blog
    digital marketing course
    digital marketing course in chennai
    digital marketing training
    skartec digital marketing academy

  74. Nice Blog
    Great Information.
    Makeup Course
    #makeupCourse #NutritionCourse #HairCourse #SpaCourse #CosmetologyCourse #NailCourse #AestheticsSkinCourse


  75. i am browsing this website dailly and get nice facts from here all the time

  76. I need to to thank you for your time due to this fantastic read!! I definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
    Java Training in Bangalore
    UI Development Training in Marathahalli

  77. Hello Admin!

    Thanks for the post. It was very interesting and meaningful. I really appreciate it! Keep updating stuffs like this. If you are looking for the Advertising Agency in Chennai | Printing in Chennai , Visit Inoventic Creative Agency Today..

  78. Great Article. Thank you for sharing! Really an awesome post for every one.
    Digital Marketing Course In Kolkata
    Web Design Course In Kolkata


    Yang Merupakan Agen Bandarq, Domino 99, Dan Bandar Poker Online Terpercaya di asia hadir untuk anda semua dengan permainan permainan menarik dan bonus menarik untuk anda semua

    Bonus yang diberikan NagaQQ :
    * Bonus rollingan 0.5%,setiap senin di bagikannya
    * Bonus Refferal 10% + 10%,seumur hidup
    * Bonus Jackpot, yang dapat anda dapatkan dengan mudah
    * Minimal Depo 15.000
    * Minimal WD 20.000

    Memegang Gelar atau title sebagai QQ Online Terbaik di masanya

    Games Yang di Hadirkan NagaQQ :
    * Poker Online
    * BandarQ
    * Domino99
    * Bandar Poker
    * Bandar66
    * Sakong
    * Capsa Susun
    * AduQ
    * Perang Bacarrat (New Game)

    Tersedia Deposit Via pulsa :
    Telkomsel & XL

    Info Lebih lanjut Kunjungi :
    Website : NAGAQQ
    Facebook : NagaQQ Official
    Kontakk : Info NagaQQ
    linktree : Agen Judi Online
    WHATSAPP : +855977509035
    Line : Cs_nagaQQ
    TELEGRAM : +855967014811

    agen bandarq terbaik
    Winner NagaQQ
    Daftar NagaQQ
    Agen Poker Online

  80. Thanks for sharing such a great information..Its really nice and informative..

    sapui5 tutorial

  81. This is a topic that's near to my heart... free Take care! Exactly where are your contact details though?

  82. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..

    sap bw online training

  83. i have been following this website blog for the past month. i really found this website was helped me a lot and every thing which was shared here was so informative and useful. again once i appreciate their effort they are making and keep going on.

    Digital Marketing Consultant in Chennai

    Freelance Digital Marketing Consultant

    SEO Consultant

    digital marketing in Chennai

  84. It’s hard to come by experienced people about this subject, but you seem like you know what you’re talking about! Thanks.
    Java Training in Bangalore
    Python Training In Bangalore

  85. thanks for sharing this informative article
    please visit this site for famous celebrities biography

  86. Snapdeal lucky winner 2020 | Snapdeal online lucky Draw 2020 | Snapdeal Winner List 2020 here came up with an Offer where you can win Snapdeal prize by just playing a game & win prizes
    snapdeal winner prizes 2020
    Snapdeal winner 2020
    Snapdeal lucky Draw 2020
    Snapdeal online lucky draw 2020

  87. Hello there! This is my first comment here, so I just wanted to give a quick shout out and say I genuinely enjoy reading your articles.

    india seo service company
    Hire Data Scientists
    front end web developer
    Front End Developer