Rev 6111: Just add a failing test with no changes to fdatasync. in http://bazaar.launchpad.net/~jameinel/bzr/integration

John Arbash Meinel john at arbash-meinel.com
Mon Aug 29 17:29:30 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/integration

------------------------------------------------------------
revno: 6111
revision-id: john at arbash-meinel.com-20110829172903-kfbf8jeqre4pz3q3
parent: pqm at pqm.ubuntu.com-20110829141242-gqvd3pz0tdcgnhfy
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: integration
timestamp: Mon 2011-08-29 19:29:03 +0200
message:
  Just add a failing test with no changes to fdatasync.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_transport.py'
--- a/bzrlib/tests/test_transport.py	2011-08-15 14:31:55 +0000
+++ b/bzrlib/tests/test_transport.py	2011-08-29 17:29:03 +0000
@@ -740,16 +740,19 @@
 
 class TestLocalTransportWriteStream(tests.TestCaseWithTransport):
 
+    def check_for_fdatasync(self):
+        sentinel = object()
+        fdatasync = getattr(os, 'fdatasync', sentinel)
+        if fdatasync is sentinel:
+            raise tests.TestNotApplicable('fdatasync not supported')
+
     def test_local_fdatasync_calls_fdatasync(self):
         """Check fdatasync on a stream tries to flush the data to the OS.
-        
+
         We can't easily observe the external effect but we can at least see
         it's called.
         """
-        sentinel = object()
-        fdatasync = getattr(os, 'fdatasync', sentinel)
-        if fdatasync is sentinel:
-            raise tests.TestNotApplicable('fdatasync not supported')
+        self.check_for_fdatasync()
         t = self.get_transport('.')
         calls = self.recordCalls(os, 'fdatasync')
         w = t.open_write_stream('out')
@@ -760,6 +763,9 @@
             self.assertEquals(f.read(), 'foo')
         self.assertEquals(len(calls), 1, calls)
 
+    def test_failing_test(self):
+        self.fail('This is how long it takes to fail with fdatasync on.')
+
 
 class TestWin32LocalTransport(tests.TestCase):
 



More information about the bazaar-commits mailing list