CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
785 stars 75 forks source link

FileNotFoundError when running green's own tests #197

Closed Ogaday closed 5 years ago

Ogaday commented 5 years ago

Looks like a similar bug to #154, but that issue is closed.

Steps to reproduce:

$ git clone git@github.com:CleanCut/green.git
Cloning into 'green'...
remote: Enumerating objects: 4220, done.
remote: Total 4220 (delta 0), reused 0 (delta 0), pack-reused 4220
Receiving objects: 100% (4220/4220), 1.79 MiB | 2.51 MiB/s, done.
Resolving deltas: 100% (2874/2874), done.
$ cd green
$ python3.6 -m virtualenv -p /usr/bin/python3.6 venv
$ source venv/bin/activate
(venv) $ pip install -e .
...
Successfully installed green
(venv) $ green --version
Green 2.13.0, Coverage 4.5.1, Python 3.6.7
(venv) $ green green.test.test_process.TestPoolRunner -vvv
Green 2.13.0, Coverage 4.5.1, Python 3.6.7

green.test.test_process
  TestPoolRunner
.   SyntaxError gets reported as an error loading the unit test
.   Accessing a bad attribute is only reported once (see #150)
.   Exception raised running unit test is reported as an error
.   Runs normally
.   Avoid FileNotFoundError when using a multiprocessing.Value, fixes #154. This test never fails, we have to watch the outer stderr to see if we get output like this:
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/util.py", line 262, in _run_finalizers
    finalizer()
  File "/usr/lib/python3.6/multiprocessing/util.py", line 186, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/home/ogaday/Code/green/venv/lib/python3.6/shutil.py", line 471, in rmtree
    onerror(os.lstat, path, sys.exc_info())
  File "/home/ogaday/Code/green/venv/lib/python3.6/shutil.py", line 469, in rmtree
    orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmprm5tqg6m/pymp-wwyj7y3l'

Ran 5 tests in 0.118s

OK (passes=5)

I'm running ubuntu 18.04.

Should I be running the tests differently, ie. with make? If this is a bug and not user error, I'm happy to dig into it a bit.

CleanCut commented 5 years ago

I finally found the time to dig into this. This is a regression in #173 that broke the fix in #154 on some versions of Python on some platforms. I'm surprised it wasn't lighting up TravisCI like a Christmas tree. Fixed it by reverting to the state in #154.

CleanCut commented 5 years ago

Fix is in 2.13.1 (just released).