-
Notifications
You must be signed in to change notification settings - Fork 32
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
Harmonize loggers #1101
Harmonize loggers #1101
Conversation
@kba Sorry, can't reproduce.
But I didn't recognize anything related to the logging handling ... |
@kba, I cannot reproduce the bug as well. Getting the same errors above. Could you share the logging configuration file you are using? |
The last commit was just a frantic try to fix before the weekend, I'll force-push that out of the PR. The relevant error message is for commit 660b468 (https://app.circleci.com/pipelines/github/OCR-D/core/2010/workflows/d45d734f-7a79-46ed-9c60-acb69d9e8881/jobs/8208) |
And it's a heisenbug because it only happens when the full test suite is run, running the logging test in isolation doesn't raise the error. |
8f05b0d
to
660b468
Compare
Well if it always happens if full suite is run, it shall be reproducible and therefore can't be considered to be a Heisenbug 🙂 I do faintly remember similar phenomenons once upon a time when there were serious attempts made to re-write the whole testing suites with pytest only 🧐 Tried to update to
Something like this shouldn't happen of course. Obviously there must some strange dependencies be hidden, concerning tests doing changes to the environment or alike. A quick look into Probably one should investigate further the top of the failure message:
Why is this closed? |
Heisenbug in the sense that there is some weird entanglement/mysterious action at a distance with the other tests ;)
The module is only loaded once, that is not the issue here.
Yes, but I don't know why or at what point. I suspect this has to do with the logging handlers. They are added to the root handler, e.g.
but not removed. And in the But honestly, I am stumped right now, this is just very confusing behavior. I'll investigate the root handler idea further tomorrow... |
660b468
to
4ee7789
Compare
OK, I gave up (for now) and reduced the changes to just aligning logging in ocrd_network and the rest of the software and renaming loggers to simplify configuration. I've kept the work-in-progress in https://github.com/OCR-D/core/tree/harmnize-loggers-WIP to be revisited once the more pressing issues are out of the way. The problems are based around pytest capturing stdout/stderr, click capturing stdout/stderr, pytest adding log handlers to the root logger, us adding log handlers, streams being closed and reopened at various places and the order of tests... |
This is a colophon to #1080
ocrd_network
now are derived from theocrd
loggerocrd_network
explicitocrd_network
and porting the defaults to the config file andocrd_utils.logging
resp.Unfortunately, there is a heisenbug for (ironically)
test_log_error
intests/cli/test_log.py
. Error goes away when replacing theStreamHandler
ofconsoleHandler
with aFileHandler
in the logging configuration - which isn't even used in that test. I triedgit bisecting
through the changes, but it only appears in the commit 660b468. If anybody (@M3ssman perhaps?) has an idea, pls let me know.