]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Reduced file size to prevent timeout
authorJacob Gregor <jgregor@us.ibm.com>
Thu, 13 Aug 2015 20:31:16 +0000 (15:31 -0500)
committerJacob Gregor <jgregor@us.ibm.com>
Fri, 14 Aug 2015 20:34:27 +0000 (15:34 -0500)
We currently have a test system that appears to be I/O constrained
and is hitting timeouts. Rather than mocking out the file copy, we
decided to reduce the file size in order to avoid timeouts. This way
we are not changing the way these test cases work, but we are reducing
the time required to run each test case. This patch will help improve
check and gate performance as well.

Change-Id: I04cf9d6dbdaebb8944a38ffa34d1e2e1b27e2552
Closes-bug: 1480361

cinder/tests/unit/backup/drivers/test_backup_nfs.py
cinder/tests/unit/test_backup_swift.py

index 06a5eeb631bb6beb74945c5b135d3dcc807da049..be9186863c51f68337d9e021b4e8aebcf88cdac8 100644 (file)
@@ -145,7 +145,7 @@ class BackupNFSSwiftBasedTestCase(test.TestCase):
                          mock.Mock(return_value=mock_remotefsclient))
         # Remove tempdir.
         self.addCleanup(shutil.rmtree, self.temp_dir)
-        for _i in range(0, 128):
+        for _i in range(0, 32):
             self.volume_file.write(os.urandom(1024))
 
     def test_backup_uncompressed(self):
@@ -261,7 +261,7 @@ class BackupNFSSwiftBasedTestCase(test.TestCase):
 
         # Verify sha contents
         content1 = service._read_sha256file(backup)
-        self.assertEqual(128 * 1024 / content1['chunk_size'],
+        self.assertEqual(32 * 1024 / content1['chunk_size'],
                          len(content1['sha256s']))
 
     def test_backup_cmp_shafiles(self):
index 5f6843490965a0fe0be0a4885f8ce75a17515dff..c0fb78690dfe35b899b6b070fb12ff966ce6a0b8 100644 (file)
@@ -91,7 +91,7 @@ class BackupSwiftTestCase(test.TestCase):
         self.addCleanup(self.volume_file.close)
         # Remove tempdir.
         self.addCleanup(shutil.rmtree, self.temp_dir)
-        for _i in range(0, 128):
+        for _i in range(0, 64):
             self.volume_file.write(os.urandom(1024))
 
     def test_backup_swift_url(self):
@@ -237,7 +237,7 @@ class BackupSwiftTestCase(test.TestCase):
 
         # Verify sha contents
         content1 = service._read_sha256file(backup)
-        self.assertEqual(128 * 1024 / content1['chunk_size'],
+        self.assertEqual(64 * 1024 / content1['chunk_size'],
                          len(content1['sha256s']))
 
     def test_backup_cmp_shafiles(self):