-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ulimit flag #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for a well written plugin with good coverage. I have one request for the tests to improve the error capture if they fail. Otherwise this looks good to me.
def setUp(self): | ||
self._instance = Ulimit() | ||
|
||
def _is_arg_translation_ok(self, mock_cliargs, expected): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for comprehensive tests. Could you change this function to return a tuple of the success and message as a tuple that can then be passed to assertFalse or assertTrue so that the message gets captured in the unit test report not just in the console output.
The return would be (is_ok, message_string)
test/test_ulimit.py
Outdated
"""Test single soft limit argument.""" | ||
mock_cliargs = ["rtprio=99"] | ||
expected = " --ulimit rtprio=99" | ||
self.assertTrue(self._is_arg_translation_ok(mock_cliargs, expected)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.assertTrue(self._is_arg_translation_ok(mock_cliargs, expected)) | |
self.assertTrue(*self._is_arg_translation_ok(mock_cliargs, expected)) |
With the addition of the tuple return of the helper method this will expand the results into the assertTrue arguments.
Thanks for the feedback! I've addressed the requests on the latest commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the iteration. It looks good to me now.
Hi, this PR adds support for the
ulimit
flag (https://docs.docker.com/reference/cli/docker/container/run/#ulimit). This flag is useful when running ROS 1 containers in machines with highnofile
limits (default in Arch Linux) since not limiting this causes system crashes (please read https://answers.ros.org/question/336963/rosout-high-memory-usage/ for more info).This PR adds:
Ulimit
class that extendsRockerExtension
to add support for the--ulimit
flag in Dockerhelp
command and when raising argument type exception (similar to theVolume
extension)