diff options
Diffstat (limited to 'src/subprocess_test.cc')
-rw-r--r-- | src/subprocess_test.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc index d7ecb33..c155012 100644 --- a/src/subprocess_test.cc +++ b/src/subprocess_test.cc @@ -142,11 +142,19 @@ TEST_F(SubprocessTest, SetWithMulti) { } } -#ifdef OS_LINUX +#ifdef linux TEST_F(SubprocessTest, SetWithLots) { // Arbitrary big number; needs to be over 1024 to confirm we're no longer // hostage to pselect. const size_t kNumProcs = 1025; + + // Make sure [ulimit -n] isn't going to stop us from working. + rlimit rlim; + ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlim)); + ASSERT_GT(rlim.rlim_cur, kNumProcs) + << "Raise [ulimit -n] well above " << kNumProcs + << " to make this test go"; + vector<Subprocess*> procs; for (size_t i = 0; i < kNumProcs; ++i) { Subprocess* subproc = subprocs_.Add("/bin/echo"); @@ -161,4 +169,4 @@ TEST_F(SubprocessTest, SetWithLots) { } ASSERT_EQ(kNumProcs, subprocs_.finished_.size()); } -#endif +#endif // linux |