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
api, core: make scheduled executor service accessible for NameResolver.Args #6455
Changes from 3 commits
902990e
61c87dc
4fed79b
26d8181
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 |
---|---|---|
|
@@ -70,6 +70,7 @@ | |
import java.util.Map; | ||
import java.util.Random; | ||
import java.util.concurrent.Executor; | ||
import java.util.concurrent.ScheduledExecutorService; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
import java.util.logging.Level; | ||
|
@@ -116,6 +117,7 @@ public void uncaughtException(Thread t, Throwable e) { | |
.setProxyDetector(GrpcUtil.DEFAULT_PROXY_DETECTOR) | ||
.setSynchronizationContext(syncContext) | ||
.setServiceConfigParser(mock(ServiceConfigParser.class)) | ||
.setScheduledExecutorService(mock(ScheduledExecutorService.class)) | ||
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. This one too. Is it necessary to set it? Can we leave it unset everywhere it is unused? 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. Sure. It doesn't matter much. I set it just for completeness. 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. I'm mainly requesting it because it makes the tests more bug-prone. As it is now if the code starts using the scheduled executor service it will throw and then it is clear a FakeClock needs to be injected. With the mock it just silently doesn't do anything. |
||
.setChannelLogger(mock(ChannelLogger.class)) | ||
.build(); | ||
|
||
|
@@ -177,6 +179,7 @@ private DnsNameResolver newResolver( | |
.setProxyDetector(proxyDetector) | ||
.setSynchronizationContext(syncContext) | ||
.setServiceConfigParser(mock(ServiceConfigParser.class)) | ||
.setScheduledExecutorService(mock(ScheduledExecutorService.class)) | ||
.setChannelLogger(mock(ChannelLogger.class)) | ||
.build(); | ||
return newResolver(name, stopwatch, isAndroid, args); | ||
|
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.
Why not leave unset?