-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
dotnet.exe prints error messages to console when launched with empty DOTNET_MULTILEVEL_LOOKUP #84322
Conversation
…DOTNET_MULTILEVEL_LOOKUP
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
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.
We should add a test to validate that nothing goes to stderr.
since warnings do not go anywhere, checking stderr would not be useful. |
Co-authored-by: Vitek Karas <[email protected]>
We try to add regression tests for pretty much every fix. So in this case the test should fail before the change and pass after. The tests also often enable tracing which will make the warnings visible and verifiable. |
Since we don't always read DOTNET_MULTILEVEL_LOOKUP (since it is disabled in latest versions) and the root issue concerns any environment variable we read, it probably makes sense to target a another specific variable. Incorrectly writing to stderr in the STARTUP_HOOK case was reported in #82260. We have an existing test that sets an empty value for the STARTUP_HOOK environment variable - that should be updated to check that nothing is written to stderr.
We also have tests setting an empty DOTNET_ROOT:
|
.EnvironmentVariable(Constants.HostTracing.TraceLevelEnvironmentVariable, "1") | ||
.EnvironmentVariable(Constants.HostTracing.VerbosityEnvironmentVariable, "2") | ||
.CaptureStdOut() | ||
.CaptureStdErr() |
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 can be replaced with .EnableTracingAndCaptureOutputs
, it does not set verbosity (so it defaults to everything), but that should work for this test as well.
Similarly in the other places.
src/installer/tests/HostActivation.Tests/PortableAppActivation.cs
Outdated
Show resolved
Hide resolved
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.
Thank you!
/backport to release/7.0-staging |
Started backporting to release/7.0-staging: https://github.com/dotnet/runtime/actions/runs/5299837208 |
/backport to release/6.0-staging |
Started backporting to release/6.0-staging: https://github.com/dotnet/runtime/actions/runs/5522137951 |
Fixes #54073
Fixes #82260