-
Notifications
You must be signed in to change notification settings - Fork 96
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
logger is not able to write to log file after tests complete #6000
Comments
tchaikov
added a commit
to tchaikov/scylla-cluster-tests
that referenced
this issue
Apr 10, 2023
pytest's capsys just closes the stdout when done with tests. there are issues tracking this problem, see pytest-dev/pytest#5577 . but we adds a handler which redirect the logging messages to stdout. so, once pytest finishes testing, exceptions are raised when writing logging messages, like ``` 22:37:20 File "/usr/local/lib/python3.10/logging/__init__.py", line 1101, in emit 22:37:20 stream.write(msg + self.terminator) 22:37:20 ValueError: I/O operation on closed file. ``` so, in this change, `logging.raiseExceptions` is disabled when pytest's session finishes. Fixes scylladb#6000 Signed-off-by: Kefu Chai <[email protected]>
7 tasks
Probably better to point to Where there's ongoing discussion, in our case it's mostly cosmetic, but we can copy the suggestion to disable the loggers |
@fruch i am fine either way. but i'd prefer simpler solutions if possible. |
fruch
pushed a commit
that referenced
this issue
Apr 10, 2023
pytest's capsys just closes the stdout when done with tests. there are issues tracking this problem, see pytest-dev/pytest#5577 . but we adds a handler which redirect the logging messages to stdout. so, once pytest finishes testing, exceptions are raised when writing logging messages, like ``` 22:37:20 File "/usr/local/lib/python3.10/logging/__init__.py", line 1101, in emit 22:37:20 stream.write(msg + self.terminator) 22:37:20 ValueError: I/O operation on closed file. ``` so, in this change, `logging.raiseExceptions` is disabled when pytest's session finishes. Fixes #6000 Signed-off-by: Kefu Chai <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
stop_events_device
is registered ontoatexit
instart_events_device()
. seescylla-cluster-tests/sdcm/sct_events/setup.py
Line 74 in 590b9ef
logging.getLogger(__name__)
, seescylla-cluster-tests/sdcm/sct_events/setup.py
Line 97 in 590b9ef
scylla-cluster-tests/sdcm/utils/log.py
Lines 11 to 15 in 590b9ef
unforunately, pytest's capsys just closes the stdout when done with tests. there are issues tracking this problem, see pytest-dev/pytest#5577 .
the symptom of this issue is following error message:
see https://jenkins.scylladb.com/job/sct-github-PRs-scan/job/scylla-cluster-tests/job/PR-5993/workflow-stage/
The text was updated successfully, but these errors were encountered: