Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7545191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:51:54+00:00 2026-05-30T08:51:54+00:00

The problem is: Manipulating external state in a test file reduces the possible parallelism

  • 0

The problem is:

Manipulating external state in a test file reduces the possible parallelism of your test suite.

What I’m testing is precisely manipulating external state (and then resetting it).

I’d still like to run in parallel most of the time. I’d then just like to skip the tests that would manipulate external state, which might make others fail.

So I would work around this problem by detecting the parallelism condition and then skip the test that would manipulate external state, thereby causing others to fail. Is that doable? How?

Note that just parsing the environment variable HARNESS_OPTIONS from your script isn’t sufficient to detect the condition: prove -j3, for instance, won’t set it.

Update

While there are lots of ways to let your test script know it’s being run in a parallel harness (see Brian’s answer below), there isn’t one standard way of doing so, which I thought there might be (but didn’t phrase this properly into my question).

I was thinking of something like, hmm, well, I read it in your (great!) Effective Perl Programming book, brian, something like maintainer tests, not sure of the term now, which you’d typically only run if you’re the maintainer of the module, not during installation on a user’s computer. Seem to remember there was a convention of using some environement variable for that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:51:55+00:00Added an answer on May 30, 2026 at 8:51 am

    The prove command creates the test harness object itself, so it passes arguments directly to the constructor of the test harness class (usually TAP::Harness). You don’t get to see those arguments.

    There are several ways you can go here:

    • Write a wrapper for prove to also set the environment variable if you use -j3.
    • Make your own subclass of Test::Harness to do the same if it gets the jobs argument and specify the subclass in your config for prove.
    • Don’t use prove (my favorite).
    • Use a semaphore from your test programs to note that another test program has control
    • Move the external interactions parts to a common library that can tell its callers if someone already has control
    • Many other things
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a median filter, the problem is manipulating pixes are only possible
Possible Duplicate: How can I lock a file using java (if possible) I have
all I'm new to jQuery and I'm having a bit of a problem manipulating
I keep getting myself in knots when I am manipulating paths and file names
Recently, I was challenged in a recent interview with a string manipulation problem and
I am using LaTeX and I have a problem concerning string manipulation. I want
Problem: I have an address field from an Access database which has been converted
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.