http://www.perlmonks.org?node_id=1005193


in reply to Where should (or could) a distribution override HARNESS_OPTIONS?

I agree with afoken in being surprised at the thought of gcc not working properly just because it was run multiple times in parallel. I could see that causing a problem if both instances were trying to write to the same file, say, a.out, for example.

I would be surprised if a test script can impact the behavior of the invoking test harness without the test harness having explicitly set up a method for passing control information in that direction.

But you don't have to prevent the harness from trying to run tests in parallel. You just have to prevent the tests from simultaneously doing conflicting things at the same time.

The simplest way I see of doing that is having a sentinel file (pre-created as part of the distribution) for each unsharable resource. The parts of each test that need exclusive access to that resource can 'flock' the file for the duration of their use of that resource.

- tye