-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
api, core: make scheduled executor service accessible for NameResolver.Args #6455
Conversation
…utorService as it needs to be shared for name resolver as well.
…mpl for NameResolver.Args.
@@ -39,6 +40,7 @@ | |||
.setProxyDetector(mock(ProxyDetector.class)) | |||
.setSynchronizationContext(new SynchronizationContext(mock(UncaughtExceptionHandler.class))) | |||
.setServiceConfigParser(mock(ServiceConfigParser.class)) | |||
.setScheduledExecutorService(mock(ScheduledExecutorService.class)) |
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?
@@ -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 comment
The 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 comment
The 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 comment
The 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.
…r.Args (grpc#6455) Added new API on NameResolver.Args to access ScheduledExecutorService, which is wrapped transport executor.
No description provided.