]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_dirnode.py: simplejson-1.7.1 incorrectly rounds floats to two decimal places...
authorBrian Warner <warner@allmydata.com>
Tue, 12 Feb 2008 00:35:17 +0000 (17:35 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 12 Feb 2008 00:35:17 +0000 (17:35 -0700)
src/allmydata/test/test_dirnode.py

index 2dcf3c18d60095929a287869131e56d32c1595e3..327e8b9e3617f920fafd7137c1f0a1cd6d15d38e 100644 (file)
@@ -333,8 +333,15 @@ class Dirnode(unittest.TestCase, testutil.ShouldFailMixin):
             def _start(res):
                 self._start_timestamp = time.time()
             d.addCallback(_start)
+            # simplejson-1.7.1 (as shipped on Ubuntu 'gutsy') rounds all
+            # floats to hundredeths (it uses str(num) instead of repr(num)).
+            # simplejson-1.7.3 does not have this bug. To prevent this bug
+            # from causing the test to fail, stall for more than a few
+            # hundrededths of a second.
+            d.addCallback(self.stall, 0.1)
             d.addCallback(lambda res: n.add_file("timestamps",
                                                  upload.Data("stamp me")))
+            d.addCallback(self.stall, 0.1)
             def _stop(res):
                 self._stop_timestamp = time.time()
             d.addCallback(_stop)