-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Reduce log verbosity in tests #27540
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,8 @@ | |
| import io.airlift.jaxrs.JsonMapper; | ||
| import io.airlift.json.JsonCodec; | ||
| import io.airlift.json.JsonModule; | ||
| import io.airlift.log.Level; | ||
| import io.airlift.log.Logging; | ||
| import io.airlift.units.DataSize; | ||
| import io.trino.connector.CatalogHandle; | ||
| import io.trino.exchange.SpoolingExchangeInput; | ||
|
|
@@ -53,6 +55,12 @@ | |
|
|
||
| public class TestTaskDescriptorStorage | ||
| { | ||
| static { | ||
| Logging logging = Logging.initialize(); | ||
| logging.setLevel("org.hibernate.validator.internal.util.Version", Level.ERROR); | ||
| logging.setLevel("Bootstrap", Level.ERROR); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is Bootstrap?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default logger used for unnamed |
||
| } | ||
|
|
||
| private static final QueryId QUERY_1 = new QueryId("query1"); | ||
| private static final QueryId QUERY_2 = new QueryId("query2"); | ||
|
|
||
|
|
@@ -363,7 +371,10 @@ private static TaskDescriptorStorage createTaskDescriptorStorage(DataSize maxMem | |
| jsonCodecBinder(binder).bindJsonCodec(Split.class); | ||
| }); | ||
|
|
||
| Injector injector = app.initialize(); | ||
| Injector injector = app | ||
| .doNotInitializeLogging() | ||
| .quiet() | ||
| .initialize(); | ||
| JsonCodec<TaskDescriptor> taskDescriptorJsonCodec = injector.getInstance(Key.get(new TypeLiteral<>() { })); | ||
| JsonCodec<Split> splitJsonCodec = injector.getInstance(Key.get(new TypeLiteral<>() { })); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,8 @@ | |||||||
| */ | ||||||||
| package io.trino.plugin.exchange.filesystem.s3; | ||||||||
|
|
||||||||
| import io.airlift.log.Level; | ||||||||
| import io.airlift.log.Logging; | ||||||||
| import io.trino.plugin.exchange.filesystem.AbstractTestExchangeManager; | ||||||||
| import io.trino.plugin.exchange.filesystem.FileSystemExchangeManagerFactory; | ||||||||
| import io.trino.plugin.exchange.filesystem.TestExchangeManagerContext; | ||||||||
|
|
@@ -26,6 +28,11 @@ | |||||||
| public class TestS3FileSystemExchangeManager | ||||||||
| extends AbstractTestExchangeManager | ||||||||
| { | ||||||||
| static { | ||||||||
| Logging logging = Logging.initialize(); | ||||||||
| logging.setLevel("io.trino.bootstrap.exchange", Level.ERROR); | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be much more robust to have
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||
| } | ||||||||
|
|
||||||||
| private MinioStorage minioStorage; | ||||||||
|
|
||||||||
| @Override | ||||||||
|
|
||||||||
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.
In theory we could put ERROR as the default level, but that may make reproducing errors harder. Also, it opens a possibility for the code to work in tests, but not work under defaults settings (yes, i know no code semantics should depend on log levels being enabled).
So for every such special measure we should understand -- and document -- why we're doing that. Please add a line of comment for each of these perhaps exemplifying what's too verbose (at the moment of writing).
BTW sometimes we can fix the problem at source. For instance, airlift configuration logs all configured values, but afaict it's disabled in tests.
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.
also, why not INFO -> WARN, when INFO is too verbose for tests?