Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 77238
Status: open
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: MARKSTOS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 3.23
Fixed in: (no value)



Subject: wish: support partial parallel runs
I have a large slow test suite with 20,000 tests. I'd like to run my tests in parallel, but some are not prepared to run that way. I would like an option to run some tests in parallel, without running all of them in parallel. For example, something in in the name or a "Smart Comment" might be used to mark tests as parallel-ready or not-parallel- ready. I thought this feature might be useful to other people, so I'm recording the idea as a wishlist item here. Thanks! Mark
On Wed May 16 10:45:21 2012, MARKSTOS wrote: Show quoted text
> I have a large slow test suite with 20,000 tests. I'd like to run my > tests in parallel, but some are not prepared to run that way. > > I would like an option to run some tests in parallel, without running all > of them in parallel. For example, something in in the name or a "Smart > Comment" might be used to mark tests as parallel-ready or not-parallel- > ready. > > I thought this feature might be useful to other people, so I'm recording > the idea as a wishlist item here.
I've done some further research on this, and made some notes here about how `prove` might be patched to support this feature: http://stackoverflow.com/questions/11977015/how-to-run-some-but-not-all-tests-in-a- perl-test-suite-in-parallel/11977495#11977495 I may end up working on this patch myself, since it wouldn't be much more effort than coding a one-off solution for myself.
On 2012-05-16 10:45:21, MARKSTOS wrote: Show quoted text
> I have a large slow test suite with 20,000 tests. I'd like to run my > tests in parallel, but some are not prepared to run that way. > > I would like an option to run some tests in parallel, without running all > of them in parallel. For example, something in in the name or a "Smart > Comment" might be used to mark tests as parallel-ready or not-parallel- > ready. > > I thought this feature might be useful to other people, so I'm recording > the idea as a wishlist item here.
A possible workaround which works with existing prove and Test-Harness: use exclusive locks. All test scripts which should not run at the same time can have something like open my $lockfh, ">", "test.lck" or die $!; fcntl $lockfh, LOCK_EX or die $!; before the critical section. Of course, one has to be careful when using locks, as it's possible to create deadlock situations... Regards, Slaven
LOCK_EX without LOCK_NB and prove do not mix well, at least with current implementation. If you want to use LOCK_EX you must pair it with LOCK_NB and keep writing "#\n" or so similar to what has been described at https://github.com/dbsrgits/dbix-class/commit/39568b8
On Wed May 16 10:45:21 2012, MARKSTOS wrote: Show quoted text
> I have a large slow test suite with 20,000 tests. I'd like to run my > tests in parallel, but some are not prepared to run that way. > > I would like an option to run some tests in parallel, without running all > of them in parallel. For example, something in in the name or a "Smart > Comment" might be used to mark tests as parallel-ready or not-parallel- > ready. > > I thought this feature might be useful to other people, so I'm recording > the idea as a wishlist item here. > > Thanks!
I think you can use the rulesfile parameter in Test::Harness 3.31 and up to achieve what you want to achieve. Leon