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

Call to finalize fails on Windows #1

Open
mdpiper opened this issue Nov 10, 2024 · 0 comments
Open

Call to finalize fails on Windows #1

mdpiper opened this issue Nov 10, 2024 · 0 comments

Comments

@mdpiper
Copy link
Member

mdpiper commented Nov 10, 2024

See, for example, tests/test_irf::test_finalize when run in GitHub Actions.

The summary from pytest:

FAILED tests/test_irf.py::test_finalize - PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\runneradmin\\.gridmet\\daily_maximum_temperature_2019-03-15_2019-03-21.nc'

The full stack trace:

________________________________ test_finalize ________________________________
Traceback (most recent call last):
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\runner.py", line 341, in from_call
    result: TResult | None = func()
                             ~~~~^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\runner.py", line 242, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\threadexception.py", line 92, in pytest_runtest_call
    yield from thread_exception_runtest_hook()
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\threadexception.py", line 68, in thread_exception_runtest_hook
    yield
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\unraisableexception.py", line 95, in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\unraisableexception.py", line 70, in unraisable_exception_runtest_hook
    yield
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\logging.py", line 846, in pytest_runtest_call
    yield from self._runtest_for(item, "call")
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\logging.py", line 829, in _runtest_for
    yield
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\capture.py", line 880, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 122, in _multicall
    teardown.throw(exception)  # type: ignore[union-attr]
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\skipping.py", line 257, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\runner.py", line 174, in pytest_runtest_call
    item.runtest()
    ~~~~~~~~~~~~^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\python.py", line 1627, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\pluggy\_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\site-packages\_pytest\python.py", line 159, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "D:\a\gridmet_bmi\gridmet_bmi\tests\test_irf.py", line 89, in test_finalize
    model.finalize()
    ~~~~~~~~~~~~~~^^
  File "D:\a\gridmet_bmi\gridmet_bmi\gridmet_bmi\bmi_gridmet.py", line 44, in finalize
    self._model.clear_cache()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\a\gridmet_bmi\gridmet_bmi\gridmet_bmi\gridmet.py", line 77, in clear_cache
    fname.unlink()
    ~~~~~~~~~~~~^^
  File "C:\Users\runneradmin\miniconda3\envs\gridmet_bmi\Lib\pathlib\_local.py", line 746, in unlink
    os.unlink(self)
    ~~~~~~~~~^^^^^^
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\runneradmin\\.gridmet\\daily_maximum_temperature_2019-03-15_2019-03-21.nc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant