Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_return_code failure on windows #162

Closed
mtreinish opened this issue Apr 14, 2018 · 2 comments
Closed

test_return_code failure on windows #162

mtreinish opened this issue Apr 14, 2018 · 2 comments
Labels
bug CI Failure For issues with the CI systems

Comments

@mtreinish
Copy link
Owner

mtreinish commented Apr 14, 2018

Issue description

When running the stestr unit tests in the test_return_codes module in a windows environment we encountered a failure in cleanup trying to remove the temporary directory created to setup the functional environment:

https://ci.appveyor.com/project/mtreinish/stestr/build/1.0.478/job/k9bm98380del4g2x

In case that link ever dies the trace back is:

==============================
Failed 1 tests - output below:
==============================
stestr.tests.test_return_codes.TestReturnCodes.test_until_failure_fails_from_func
---------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    b'Traceback (most recent call last):'
    b'  File "C:\\projects\\stestr\\.tox\\py36\\lib\\shutil.py", line 494, in rmtree'
    b'    return _rmtree_unsafe(path, onerror)'
    b'  File "C:\\projects\\stestr\\.tox\\py36\\lib\\shutil.py", line 393, in _rmtree_unsafe'
    b'    onerror(os.rmdir, path, sys.exc_info())'
    b'  File "C:\\projects\\stestr\\.tox\\py36\\lib\\shutil.py", line 391, in _rmtree_unsafe'
    b'    os.rmdir(path)'
    b"PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\\\Users\\\\appveyor\\\\AppData\\\\Local\\\\Temp\\\\1\\\\stestr-unitriyexd7t'"
    b''

It looks like the subprocess stestr is still accessing the temporary directory, but it definitely should have exited by the time cleanup is running. So it's not clear why this is failing. It also passed the other 2 jobs on the appveyor build which run the same tests, just with different python versions.

@mtreinish mtreinish added bug CI Failure For issues with the CI systems labels Apr 27, 2018
mtreinish added a commit that referenced this issue Apr 27, 2018
This commit is an attempt to mitigate #162 where the temp directory
removal is failing on windows CI occasionally. This commit sets the
ignore_errors flag on the shutil.rmtree() call which makes any errors
encountered not fatal. While this isn't ideal because it could result
in leaking the temp directories on test runs. But, since we haven't
encountered this failure on any operating system or environment
besides the windows CI in appveyor the risk of that weighed against
the nondeterministic failures blocking changes minimizes that concern.
@mtreinish
Copy link
Owner Author

Since we moved to azure pipelines and then to GHA I haven't seen this anymore so I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CI Failure For issues with the CI systems
Projects
None yet
Development

No branches or pull requests

1 participant