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

Running unit tests throw logging error #2302

Open
dg1223 opened this issue Feb 28, 2024 · 0 comments
Open

Running unit tests throw logging error #2302

dg1223 opened this issue Feb 28, 2024 · 0 comments

Comments

@dg1223
Copy link
Contributor

dg1223 commented Feb 28, 2024

Running unit tests on local machine throws logging error. Tests run successfully. No other side effects.

I believe the Logging error occurs because of an IO error when ShutdownManager.py tries to use the default Python logger. Ganga is unable to store the test logs probably because it is trying to access an already closed file.

Run tests

python -m pytest ganga/GangaCore/test/Unit

Output

================================================================================ test session starts ================================================================================
platform linux -- Python 3.8.5, pytest-8.0.2, pluggy-1.4.0 -- /home/[redacted]/ganga/gangaenv/bin/python3
cachedir: .pytest_cache
rootdir: /home/[redacted]/ganga
configfile: setup.cfg
plugins: mock-3.12.0, cov-4.1.0, pylint-0.21.0
collected 141 items                                                                                                                                                                 

ganga/GangaCore/test/Unit/Credentials/TestCredentialInfo.py::Unit.Credentials.TestCredentialInfo.FakeShell PASSED                                                             [  0%]
...
ganga/GangaCore/test/Unit/Utility/TestUtilitiesVirtualizationInstallUDocker.py::TestInstallUDocker::test_installUDocker_success PASSED                                        [100%]

=============================================================================== 141 passed in 41.52s ================================================================================
--- Logging error ---
Traceback (most recent call last):
  File "/home/[redacted]/anaconda3/lib/python3.8/logging/__init__.py", line 1084, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/[redacted]/ganga/ganga/GangaCore/Core/InternalServices/ShutdownManager.py", line 46, in _protected_ganga_exitfuncs
    _unprotected_ganga_exitfuncs()
  File "/home/[redacted]/ganga/ganga/GangaCore/Core/InternalServices/ShutdownManager.py", line 113, in _unprotected_ganga_exitfuncs
    logger.info("Stopping Job processing before shutting down Repositories")
Message: 'Stopping Job processing before shutting down Repositories'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/home/[redacted]/anaconda3/lib/python3.8/logging/__init__.py", line 1084, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/[redacted]/ganga/ganga/GangaCore/Core/InternalServices/ShutdownManager.py", line 46, in _protected_ganga_exitfuncs
    _unprotected_ganga_exitfuncs()
  File "/home/[redacted]/ganga/ganga/GangaCore/Core/InternalServices/ShutdownManager.py", line 120, in _unprotected_ganga_exitfuncs
    logger.info("Shutting Down Ganga Repositories")
Message: 'Shutting Down Ganga Repositories'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "/home/[redacted]/anaconda3/lib/python3.8/logging/__init__.py", line 1084, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/[redacted]/ganga/ganga/GangaCore/Core/InternalServices/ShutdownManager.py", line 46, in _protected_ganga_exitfuncs
    _unprotected_ganga_exitfuncs()
  File "/home/[redacted]/ganga/ganga/GangaCore/Core/InternalServices/ShutdownManager.py", line 121, in _unprotected_ganga_exitfuncs
    Repository_runtime.shutdown()
  File "/home/[redacted]/ganga/ganga/GangaCore/Runtime/Repository_runtime.py", line 181, in shutdown
    logger.info('Registry Shutdown')
Message: 'Registry Shutdown'
Arguments: ()
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