This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pablogsal, vstinner
Date 2018-12-11.10:37:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1544524658.21.0.788709270274.issue35458@psf.upfronthosting.co.za>
In-reply-to
Content
Extract of the test:

        usage = shutil.disk_usage(os.path.dirname(__file__))
        self.assertEqual(usage, shutil.disk_usage(__file__))

The test fails if another process creates or removes data on the disk partition. IMHO "self.assertEqual(usage, shutil.disk_usage(__file__))" must be removed, it cannot be reliable without mocking os.statvfs() / nt._getdiskusage().

Even if tests are run sequentially, the test can fail if a program creates a file between the two lines of code, the test cannot be reliable.

https://buildbot.python.org/all/#/builders/85/builds/1882

FAIL: test_disk_usage (test.test_shutil.TestShutil)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shager/cpython-buildarea/3.x.edelsohn-fedora-ppc64le/build/Lib/test/test_shutil.py", line 1366, in test_disk_usage
    self.assertEqual(usage, shutil.disk_usage(__file__))
AssertionError: usage(total=1925696024576, used=1793793806336, free=131902218240) != usage(total=1925696024576, used=1793793818624, free=131902205952)
History
Date User Action Args
2018-12-11 10:37:38vstinnersetrecipients: + vstinner, pablogsal
2018-12-11 10:37:38vstinnersetmessageid: <1544524658.21.0.788709270274.issue35458@psf.upfronthosting.co.za>
2018-12-11 10:37:38vstinnerlinkissue35458 messages
2018-12-11 10:37:37vstinnercreate