classification
Title: "tests may fail, unable to create temporary directory" warning on buildbot: add a cleanup step to buildbots
Type: Stage: resolved
Components: Tests Versions: Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: neyuru, serhiy.storchaka, vstinner, zach.ware
Priority: normal Keywords: buildbot

Created on 2017-04-26 13:17 by vstinner, last changed 2019-01-07 15:25 by neyuru. This issue is now closed.

Messages (4)
msg292340 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-26 13:17
On buildbots, it's common to see such warning:


0:32:04 [269/404] test_property passed -- running: test_multiprocessing_spawn (74 sec)
D:\buildarea\3.x.bolen-windows10\build\lib\test\support\__init__.py:1012: RuntimeWarning: tests may fail, unable to create temporary directory 'D:\\buildarea\\3.x.bolen-windows10\\build\\build\\test_python_1048': [WinError 183] Cannot create a file when that file already exists: 'D:\\buildarea\\3.x.bolen-windows10\\build\\build\\test_python_1048'
  with temp_dir(path=name, quiet=quiet) as temp_path:
running: test_cmd_line_script (30 sec), test_multiprocessing_spawn (104 sec)

I also got it *sometimes*. It took me months to understand where it does come from.

It's quite stupid in fact: temporary directories are not removed if a test does crash (ex: segfault). Later, if a test process has the same PID than the crashed process, you get the warning.

I suggest to add a "clean" step on buildbots to first remove old "test_python_*" directories leaked by previous runs.

First, I wanted to add such cleanup in regrtest directly, but it's common that I run two main regrtest processes in parallel, and I would like to keep this feature. If regrtest starts by removing test_python_*: it will break currently running tests.

I'm not 100% confident that the warning is caused by previous runs, but I think that it's worth it to try to cleanup to check if it's case ;-)
msg292345 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-04-26 13:40
I also see this warning on AppVeyor:

0:01:42 [170/404] test_fcntl skipped -- running: test_concurrent_futures (76 sec)
C:\projects\cpython\lib\test\support\__init__.py:1012: RuntimeWarning: tests may fail, unable to create temporary directory 'C:\\projects\\cpython\\build\\test_python_1080': [WinError 183] Cannot create a file when that file already exists: 'C:\\projects\\cpython\\build\\test_python_1080'
  with temp_dir(path=name, quiet=quiet) as temp_path:
test_fcntl skipped -- No module named 'fcntl'
0:01:42 [171/404] test_eintr passed -- running: test_concurrent_futures (76 sec)

https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.1476
msg333164 - (view) Author: Jorge Ramos (neyuru) * Date: 2019-01-07 15:23
I got this error trying to build Python 3.6.7, why is this closed?

Running PGInstrument|x64 interpreter...
E:\RepoGiT\3.6\lib\test\support\__init__.py:1029: RuntimeWarning: tests may fail, unable to create temp dir: D:\Users\yorch\AppData\Local\Temp\test_python_15660
  with temp_dir(path=name, quiet=quiet) as temp_path:
Run tests sequentially
msg333166 - (view) Author: Jorge Ramos (neyuru) * Date: 2019-01-07 15:25
May I add that this directory exists, maybe before this run tried to create it and hence not being able to do it as the first post suggested?
History
Date User Action Args
2019-01-07 15:25:29neyurusetmessages: + msg333166
2019-01-07 15:23:53neyurusetnosy: + neyuru
messages: + msg333164
2018-09-19 23:11:23vstinnersetstatus: open -> closed
resolution: out of date
stage: resolved
2017-04-26 13:40:31vstinnersetmessages: + msg292345
2017-04-26 13:17:22vstinnercreate