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

Separately limit concurrent builds or tests #311

Open
sourcefrog opened this issue Mar 16, 2024 · 3 comments
Open

Separately limit concurrent builds or tests #311

sourcefrog opened this issue Mar 16, 2024 · 3 comments
Labels
performance Making cargo mutants faster

Comments

@sourcefrog
Copy link
Owner

In some trees the test suite might be a lot more (or less) resource intensive than the build.

Linking is often single threaded so it could be good to run many builds in parallel, but if the test suite is very hungry then just setting a high -j may overload the machine.

We could use a semaphore to limit how many threads can be running tests at any time.

@rbtcollins
Copy link

Cargo and rustc use the jobserver protocol, possibly you can hook into that.

@sourcefrog
Copy link
Owner Author

Yes I think running a single jobserver across all children is a good idea, but probably a separate issue from this one, so I filed #317.

A jobserver would manage resource contention across different builds and stop them thrashing each other, but I don't think that cargo test or the test framework talk to it, so it wouldn't manage resources between hungry test suites.

(Arguably Nextest, at least, could use it though.)

@rbtcollins
Copy link

Ah indeed cargo test doesn't yet - rust-lang/cargo#5609 has some discusssion

@sourcefrog sourcefrog added the performance Making cargo mutants faster label Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Making cargo mutants faster
Projects
None yet
Development

No branches or pull requests

2 participants