Skip to content

Skip tests when there's no space left on device? #97642

@sobolevn

Description

@sobolevn

Right now buildbots sometimes fail with something like:

======================================================================
ERROR: test_zipfile (test.test_multiprocessing_main_handling.SpawnCmdLineTest.test_zipfile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/test/test_multiprocessing_main_handling.py", line 223, in test_zipfile
    with os_helper.temp_dir() as script_dir:
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/test/support/os_helper.py", line 467, in temp_dir
    path = tempfile.mkdtemp()
           ^^^^^^^^^^^^^^^^^^
  File "/buildbot/buildarea/3.x.pablogsal-arch-x86_64/build/Lib/tempfile.py", line 368, in mkdtemp
    _os.mkdir(file, 0o700)
OSError: [Errno 28] No space left on device: '/tmp/tmpcuj5padp'

Log: https://buildbot.python.org/all/#/builders/484/builds/2129/steps/5/logs/stdio

The problem is that it creates some problems:

We might catch OSError with error code 28 on linux and just skip tests.
How does this sound to others?

If this looks like a good idea, I will send a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    pendingThe issue will be closed if no feedback is providedtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions