summaryrefslogtreecommitdiffstats
path: root/test/unit/common/test_utils.py
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2013-08-20 18:32:28 -0400
committerPeter Portante <pportant@redhat.com>2013-09-08 12:31:16 -0700
commitbd62696fa9fe694a1053e6c23f8c7ee0c66b76b6 (patch)
treebfcf828704ce5b91662f8597c1c56414d0eb33cb /test/unit/common/test_utils.py
parent01586181f2db85c01b3cb6c8743f4d4167848248 (diff)
Fix infinite loop for temp file renames on ENOENTv1.8.0-7grizzly
This is a port from master branch fix http://review.gluster.org/5670 to grizzly branch. For whatever reason, it appears that GlusterFS, or perhaps FUSE can continuously return ENOENT on a rename system call even when we have double checked that there is no reason to do so. That is a bug for that sub system. However, our response to that bug can result in an infinite loop, which is bad. This code reduces that to 10 attempts. In addition, we restructed the open retry loop to match, providing module constants for the upper bounds of both retry loops. BUG: 1005379 (https://bugzilla.redhat.com/show_bug.cgi?id=1005379) Change-Id: Ia2d6dd427daba3ea0461863c5ffe3aef27c88f9b Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/5670 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com> Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5848 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'test/unit/common/test_utils.py')
-rw-r--r--test/unit/common/test_utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py
index 4aae4c3..e86a0e9 100644
--- a/test/unit/common/test_utils.py
+++ b/test/unit/common/test_utils.py
@@ -585,10 +585,12 @@ class TestUtils(unittest.TestCase):
os.chdir(orig_cwd)
shutil.rmtree(td)
- def test_get_container_details(self):
+ def test_get_container_details_and_size(self):
orig_cwd = os.getcwd()
+ __do_getsize = Glusterfs._do_getsize
td = tempfile.mkdtemp()
try:
+ Glusterfs._do_getsize = False
tf = tarfile.open("common/data/container_tree.tar.bz2", "r:bz2")
os.chdir(td)
tf.extractall()
@@ -610,6 +612,7 @@ class TestUtils(unittest.TestCase):
full_dir3: os.path.getmtime(full_dir3),
}
finally:
+ Glusterfs._do_getsize = __do_getsize
os.chdir(orig_cwd)
shutil.rmtree(td)