From de57020bd1f2bf4781c14375ed1717a44cac8016 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 28 Feb 2015 11:04:09 +0100 Subject: subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs Instead of expecting that the number of open files is well above kNumProcs, simply "skip" the test in that case, still printing the message about the test limit (adding the current system limit too). --- src/subprocess_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc index 8a0787c..7759863 100644 --- a/src/subprocess_test.cc +++ b/src/subprocess_test.cc @@ -177,8 +177,8 @@ TEST_F(SubprocessTest, SetWithLots) { // Make sure [ulimit -n] isn't going to stop us from working. rlimit rlim; ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlim)); - if (!EXPECT_GT(rlim.rlim_cur, kNumProcs)) { - printf("Raise [ulimit -n] well above %u to make this test go\n", kNumProcs); + if (rlim.rlim_cur < kNumProcs) { + printf("Raise [ulimit -n] well above %u (currently %lu) to make this test go\n", kNumProcs, rlim.rlim_cur); return; } -- cgit v0.12