mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix error in test suite teardown
The error seen was: Exception ignored in atexit callback: <bound method DeferredStreamHandler.flush of <DeferredStreamHandler <_io.FileIO [closed]> (WARNING)>> Traceback (most recent call last): File "/home/dan/src/salt/salt/_logging/handlers.py", line 68, in flush super().flush() File "/usr/local/lib/python3.10/logging/__init__.py", line 1084, in flush self.stream.flush() ValueError: I/O operation on closed file.
This commit is contained in:
parent
d11775eeca
commit
64690a935c
1 changed files with 5 additions and 1 deletions
|
@ -65,7 +65,11 @@ class DeferredStreamHandler(StreamHandler):
|
|||
super().handle(record)
|
||||
finally:
|
||||
self.__emitting = False
|
||||
super().flush()
|
||||
# Seeing an exception from calling flush on a closed file in the test
|
||||
# suite. Handling this condition for now but this seems to be
|
||||
# indicitive of an un-clean teardown at some point.
|
||||
if not self.stream.closed:
|
||||
super().flush()
|
||||
|
||||
def sync_with_handlers(self, handlers=()):
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue