BewareMyPower commented on pull request #14834:
URL: https://github.com/apache/pulsar/pull/14834#issuecomment-1077043925
It looks hard to add a test. I tried to set the resource limit in tests but
cannot restore the original value.
```c++
#ifndef _MSC_VER
TEST(ClientTest, testTooManyFiles) {
struct rlimit originalLimit;
getrlimit(RLIMIT_NOFILE, &originalLimit);
struct rlimit currentLimit;
currentLimit.rlim_cur = 1;
currentLimit.rlim_max = 1;
setrlimit(RLIMIT_NOFILE, ¤tLimit);
/* Tests here ... */
setrlimit(RLIMIT_NOFILE, &originalLimit); // it failed with Operation
not permitted
}
#endif
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]