Skip to content

Commit

Permalink
rewrite libtest-thread-limit to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Aug 1, 2024
1 parent d4e07d0 commit 5602322
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ run-make/jobserver-error/Makefile
run-make/libs-through-symlinks/Makefile
run-make/libtest-json/Makefile
run-make/libtest-junit/Makefile
run-make/libtest-thread-limit/Makefile
run-make/link-cfg/Makefile
run-make/long-linker-command-lines-cmd-exe/Makefile
run-make/long-linker-command-lines/Makefile
Expand Down
7 changes: 0 additions & 7 deletions tests/run-make/libtest-thread-limit/Makefile

This file was deleted.

19 changes: 19 additions & 0 deletions tests/run-make/libtest-thread-limit/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// libtest used to panic if it hit the thread limit. This often resulted in spurious test failures
// (thread 'main' panicked at 'called Result::unwrap() on an Err value: Os
// { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }' ...
// error: test failed, to rerun pass '--lib').
// Since the fix in #81546, the test should continue to run synchronously
// if it runs out of threads. Therefore, this test's final execution step
// should succeed without an error.
// See https://github.com/rust-lang/rust/pull/81546

//@ only-linux
// Reason: the `ulimit` utility is used

use run_make_support::{cmd, run, rustc};

fn main() {
rustc().input("test.rs").arg("--test").run();
cmd("ulimit").arg("-p").arg("0").run();
run("test");
}
1 change: 1 addition & 0 deletions tests/run-make/macos-deployment-target/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// See https://github.com/rust-lang/rust/pull/105123

//@ only-macos
// Reason: this test exercises an OSX-specific issue

use run_make_support::{cmd, rustc};

Expand Down

0 comments on commit 5602322

Please sign in to comment.