diff --git a/tests/unix/ConnectionFailTest.cc b/tests/unix/ConnectionFailTest.cc index a05e6a39..11ac3849 100644 --- a/tests/unix/ConnectionFailTest.cc +++ b/tests/unix/ConnectionFailTest.cc @@ -31,6 +31,10 @@ class ConnectionFailTest : public ::testing::TestWithParam { struct rlimit limit; ASSERT_EQ(getrlimit(RLIMIT_NOFILE, &limit), 0); maxFdCount_ = limit.rlim_max; + // The previous test leaves the soft fd limit lowered, which could make the HTTP request below fail + // to open a socket. Restore it before creating the topic. + limit.rlim_cur = limit.rlim_max; + ASSERT_EQ(setrlimit(RLIMIT_NOFILE, &limit), 0); int numPartitions = GetParam(); topic_ = "test-connection-fail-" + std::to_string(numPartitions) + std::to_string(time(nullptr)); if (numPartitions > 0) {