-
Notifications
You must be signed in to change notification settings - Fork 244
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
Parse introspection types separately from the provided schema #2448
Conversation
if LevelFilter::current() == LevelFilter::OFF && cfg!(not(debug_assertions)) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hack is to make tests take the potentially-panicky path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain a bit more this change and the next on line 436? The rest of the PR looks nice but that part feels weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a panicky bug. I want first to reproduce the panic in a test, then fix it. There were two obstacles to reproduction:
-
LevelFilter::current()
appears to be OFF while running test, so the panicky code path was not taken at all. This change causes some logging to stdout to happen even if logging is nominally disabled, when compiled with debug assertions such as for testing. In the test harness however, stdout is captured by default and only shown when a test fails. So this doesn’t normally add visible output.I don’t really like this weird condition, but it’ll goo away when we drop AST-based parsing. This shouldn’t print to stdout in the first place. This PR fixes the panic (and tests the fix) without waiting for that larger refactor.
-
The second obstacle is println panic suppressed by test harness stdio capture rust-lang/rust#107118 which would swallow the panic when stdout is captured by the test harness. As commented, adding
format!
works around that.
b5715fe
to
5d69975
Compare
I’d missed that |
Fixes #2269
Checklist
Complete the checklist (and note appropriate exceptions) before a final PR is raised.
Exceptions
Note any exceptions here
Notes
[^1]. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.
[^2]. Configuration is an important part of many changes. Where applicable please try to document configuration examples.
[^3]. Tick whichever testing boxes are applicable. If you are adding Manual Tests:
- please document the manual testing (extensively) in the Exceptions.
- please raise a separate issue to automate the test and label it (or ask for it to be labeled) as
manual test