[arvados] updated: 2.7.0-5456-ga05e443dbf
git repository hosting
git at public.arvados.org
Mon Dec 4 19:37:49 UTC 2023
Summary of changes:
services/fuse/tests/test_command_args.py | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
via a05e443dbfcde94651afe783e633b08d79e2b6d1 (commit)
from a773baf0d1662b7aab632bfd4f7db50b4b29a6b8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit a05e443dbfcde94651afe783e633b08d79e2b6d1
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Mon Dec 4 14:37:31 2023 -0500
21223: Add a few more --file-cache RLIMIT_NOFILE tests
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/services/fuse/tests/test_command_args.py b/services/fuse/tests/test_command_args.py
index 9f4aa53bdb..b08ab19335 100644
--- a/services/fuse/tests/test_command_args.py
+++ b/services/fuse/tests/test_command_args.py
@@ -265,18 +265,36 @@ class MountArgsTest(unittest.TestCase):
@noexit
@mock.patch('resource.setrlimit')
@mock.patch('resource.getrlimit')
- def test_file_cache(self, getrlimit, setrlimit):
+ def test_default_file_cache(self, getrlimit, setrlimit):
args = arvados_fuse.command.ArgumentParser().parse_args([
- '--foreground', '--file-cache=256000000000', self.mntdir])
+ '--foreground', self.mntdir])
self.assertEqual(args.mode, None)
-
getrlimit.return_value = (1024, 1048576)
+ self.mnt = arvados_fuse.command.Mount(args)
+ setrlimit.assert_called_with(resource.RLIMIT_NOFILE, (10240, 1048576))
+ @noexit
+ @mock.patch('resource.setrlimit')
+ @mock.patch('resource.getrlimit')
+ def test_small_file_cache(self, getrlimit, setrlimit):
+ args = arvados_fuse.command.ArgumentParser().parse_args([
+ '--foreground', '--file-cache=256000000', self.mntdir])
+ self.assertEqual(args.mode, None)
+ getrlimit.return_value = (1024, 1048576)
self.mnt = arvados_fuse.command.Mount(args)
+ setrlimit.assert_not_called()
+ @noexit
+ @mock.patch('resource.setrlimit')
+ @mock.patch('resource.getrlimit')
+ def test_large_file_cache(self, getrlimit, setrlimit):
+ args = arvados_fuse.command.ArgumentParser().parse_args([
+ '--foreground', '--file-cache=256000000000', self.mntdir])
+ self.assertEqual(args.mode, None)
+ getrlimit.return_value = (1024, 1048576)
+ self.mnt = arvados_fuse.command.Mount(args)
setrlimit.assert_called_with(resource.RLIMIT_NOFILE, (30517, 1048576))
-
@noexit
@mock.patch('resource.setrlimit')
@mock.patch('resource.getrlimit')
@@ -284,11 +302,8 @@ class MountArgsTest(unittest.TestCase):
args = arvados_fuse.command.ArgumentParser().parse_args([
'--foreground', '--file-cache=256000000000', self.mntdir])
self.assertEqual(args.mode, None)
-
getrlimit.return_value = (1024, 2048)
-
self.mnt = arvados_fuse.command.Mount(args)
-
setrlimit.assert_called_with(resource.RLIMIT_NOFILE, (2048, 2048))
class MountErrorTest(unittest.TestCase):
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list