Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parallel test execution #14

Open
felixdivo opened this issue Apr 11, 2023 · 1 comment
Open

Support parallel test execution #14

felixdivo opened this issue Apr 11, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@felixdivo
Copy link
Owner

We can use isolated ROS2 partitions to run tests in parallel. This is very useful with pytest-parallel, e.g. when you can run pytest --workers $((2 * $(nproc))). For this, you need to set the ROS_DOMAIN_ID:

import os
import random
if use_random_domain_id:
    if "ROS_DOMAIN_ID" in os.environ:
        warn("the user about the fact that they already specified it")
    os.environ["ROS_DOMAIN_ID"] = str(random.randint(0, 232))  # or maybe more clever?
@felixdivo felixdivo added enhancement New feature or request help wanted Extra attention is needed labels Apr 11, 2023
@felixdivo
Copy link
Owner Author

One can also pass domain_id to rclpy.Context.init() (relevant for @with_single_node).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant