diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-09-02 21:50:50 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-09-02 21:50:50 -0700 |
| commit | aeb2f88a4872edb38549a73f6003477d1d7b5928 (patch) | |
| tree | 3cbd074f508ca945aa3a39f7b699a64f1ab89b42 /src/libstd | |
| parent | fc9fa2cb6ca2b0979137134713fe3f693090a9d9 (diff) | |
| download | rust-aeb2f88a4872edb38549a73f6003477d1d7b5928.tar.gz rust-aeb2f88a4872edb38549a73f6003477d1d7b5928.zip | |
Raise the file descriptor limits when running compiletest
We already do this for libstd tests automatically, and compiletest runs into the same problems where when forking lots of processes lots of file descriptors are created. On OSX we can use specific syscalls to raise the limits, in this situation, though. Closes #8904
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rt/test.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs index 4e2f9fbe130..2c293af1eaf 100644 --- a/src/libstd/rt/test.rs +++ b/src/libstd/rt/test.rs @@ -144,6 +144,12 @@ mod darwin_fd_limit { pub unsafe fn raise_fd_limit() {} } +#[doc(hidden)] +pub fn prepare_for_lots_of_tests() { + // Bump the fd limit on OS X. See darwin_fd_limit for an explanation. + unsafe { darwin_fd_limit::raise_fd_limit() } +} + /// Create more than one scheduler and run a function in a task /// in one of the schedulers. The schedulers will stay alive /// until the function `f` returns. @@ -153,8 +159,8 @@ pub fn run_in_mt_newsched_task(f: ~fn()) { use rt::sched::Shutdown; use rt::util; - // Bump the fd limit on OS X. See darwin_fd_limit for an explanation. - unsafe { darwin_fd_limit::raise_fd_limit() } + // see comment in other function (raising fd limits) + prepare_for_lots_of_tests(); let f = Cell::new(f); |
