From: Neal Norwitz Date: Sun, 27 Jan 2008 17:10:50 +0000 (+0000) Subject: Add a tiny sleep and additional flush to force the file to really be synced. X-Git-Tag: v2.6a1~368 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=041ee5d373d7a335dcb2ad80268de29182789937;p=python Add a tiny sleep and additional flush to force the file to really be synced. --- diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py index f7c2976add..496259f632 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -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: