question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mix of serial and parallel tests

See original GitHub issue

Hi, I would like to run some test in parallel meanwhile other in serial. The real use is to run compute tests in parallel with storage benchmark of shared target (you do not want to run multiple differrent IOR at the same time on the same target).

Consider the following example:

@rfm.simple_test
class ARunTest(rfm.RunOnlyRegressionTest):
    descr = "A Run"
    valid_systems = ["hpc:hpc"]
    valid_prog_environs = ["*"]
    param = parameter(["AA", "AB"])
#    max_jobs = 1

    def __init__(self):
        self.executable = f"date; echo {self.param}"

#    @run_before("run")
#    def set_exec(self):
#        self.current_partition.max_jobs = 1

    @sanity_function
    def assert_passed(self):
        return True

@rfm.simple_test
class BRunTest(rfm.RunOnlyRegressionTest):
    descr = "B Run"
    valid_systems = ["hpc:hpc"]
    valid_prog_environs = ["*"]
    param = parameter(["BA", "BB"])

    def __init__(self):
        self.executable = f"date; echo {self.param}"

    @sanity_function
    def assert_passed(self):
        return True

The ARunTest should run in serial: ARunTest_AA first and on completion start ARunTest_AB. While BRunTest should run in parallel: BRunTest_BA concurrent to ARunTest_BB.

Using the default settings ARunTest_AA, ARunTest_AB, BRunTest_BA, BRunTest_BB run in parallel. Instead using the option --exec-policy=serial it will run ARunTest_AA then ARunTest_AB then BRunTest_BA then BRunTest_BB.

The trick would be to set a max_jobs = 1 variable for the class ARunTest but it is simply skipped. Or:

    @run_before("run")
    def set_exec(self):
        self.current_partition.max_jobs = 1

but I get: can't set attribute self.current_partition.max_jobs = 1

It there a workaround for this?

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yellowhatcommented, Aug 9, 2021

Thanks for the information. I will have a play and report back.

0reactions
jjoterocommented, Aug 10, 2021

Hi @yellowhat ! Glad that it worked. We will probably add the corresponding tutorial once we address all the issues mentioned above. This case access protected variables (_rfm_param_space) and it would get a lot more complicated if one has 2 or more parameters, so this is by all means a workaround and I doubt is general enough for the general audience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controlling the Serial and Parallel Test on XUnit
The Serial / Parallel Mixed Test. Collection. A collection is the unit of tests. The tests that are in the same collection, it...
Read more >
What is Parallel Testing and How Does it Work? - Semaphore CI
Parallel testing is an indispensable technique for reducing wait times. And mastering it is key to getting the most out of CI/CD.
Read more >
(PDF) Using Multiple Tests: Series and Parallel Approaches
The serial combination result was regarded as positive only when all screening test results were positive and negative when one result was ...
Read more >
Parallel Testing Guide using TestProject
Parallel Testing is a test process that concurrently runs multiple tests. We can execute 1 or more tests on multiple browsers with multiple...
Read more >
Ginkgo supports mixed execution of parallel test and serial test
Some of my test projects can be executed in parallel, and some need to be executed serially due to the high cost of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found