Skip to content

Conversation

voidzcy
Copy link
Contributor

@voidzcy voidzcy commented Nov 21, 2019

No description provided.

.setProxyDetector(mock(ProxyDetector.class))
.setSynchronizationContext(new SynchronizationContext(mock(UncaughtExceptionHandler.class)))
.setServiceConfigParser(mock(ServiceConfigParser.class))
.setScheduledExecutorService(mock(ScheduledExecutorService.class))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not leave unset?

.setProxyDetector(GrpcUtil.DEFAULT_PROXY_DETECTOR)
.setSynchronizationContext(syncContext)
.setServiceConfigParser(mock(ServiceConfigParser.class))
.setScheduledExecutorService(mock(ScheduledExecutorService.class))
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@voidzcy voidzcy merged commit eb21c64 into grpc:master Nov 22, 2019
ericgribkoff pushed a commit to ericgribkoff/grpc-java that referenced this pull request Dec 6, 2019
…r.Args (grpc#6455)

Added new API on NameResolver.Args to access ScheduledExecutorService, which is wrapped transport executor.
@lock lock bot locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants