]> granicus.if.org Git - python/commitdiff
Add a tiny sleep and additional flush to force the file to really be synced.
authorNeal Norwitz <nnorwitz@gmail.com>
Sun, 27 Jan 2008 17:10:50 +0000 (17:10 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sun, 27 Jan 2008 17:10:50 +0000 (17:10 +0000)
Lib/test/test_resource.py

index f7c2976add4121fc00dbb76b63e9dcf374dc92c7..496259f6320013e1427d824379eded67f70fc6ac 100644 (file)
@@ -1,8 +1,9 @@
 import unittest
 from test import test_support
 
-
-import os, resource
+import os
+import resource
+import time
 
 # This test is checking a few specific problem spots with the resource module.
 
@@ -59,6 +60,8 @@ class ResourceTest(unittest.TestCase):
                         # an attempt to ensure the file is really synced and
                         # the exception raised.
                         for i in range(5):
+                            time.sleep(.1)
+                            f.flush()
                             f.close()
                     except IOError:
                         if not limit_set: