[ARVADOS] updated: 16edd7c54ac58cda991d3e9f0a1b48cea3dd985c

git at public.curoverse.com git at public.curoverse.com
Tue Sep 22 15:21:52 EDT 2015


Summary of changes:
 sdk/python/tests/test_arvfile.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

       via  16edd7c54ac58cda991d3e9f0a1b48cea3dd985c (commit)
      from  b16358fa5145d3d4bcd0ac37bd81d7605eac040f (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 16edd7c54ac58cda991d3e9f0a1b48cea3dd985c
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Sep 22 15:23:31 2015 -0400

    7225: Add test to validate fix that 2nd commit call blocks until block is committed
    as intended.

diff --git a/sdk/python/tests/test_arvfile.py b/sdk/python/tests/test_arvfile.py
index 99be4c2..330dd44 100644
--- a/sdk/python/tests/test_arvfile.py
+++ b/sdk/python/tests/test_arvfile.py
@@ -7,6 +7,7 @@ import mock
 import os
 import unittest
 import hashlib
+import time
 
 import arvados
 from arvados._ranges import Range
@@ -626,6 +627,20 @@ class BlockManagerTest(unittest.TestCase):
             self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.COMMITTED)
             self.assertIsNone(bufferblock.buffer_view)
 
+    def test_bufferblock_commit_pending(self):
+        # Test for bug #7225
+        mockkeep = mock.MagicMock()
+        mockkeep.put.side_effect = lambda x: time.sleep(1)
+        with arvados.arvfile._BlockManager(mockkeep) as blockmanager:
+            bufferblock = blockmanager.alloc_bufferblock()
+            bufferblock.append("foo")
+
+            blockmanager.commit_bufferblock(bufferblock, False)
+            self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.PENDING)
+
+            blockmanager.commit_bufferblock(bufferblock, True)
+            self.assertEqual(bufferblock.state(), arvados.arvfile._BufferBlock.COMMITTED)
+
 
     def test_bufferblock_commit_with_error(self):
         mockkeep = mock.MagicMock()

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list