Use unique service names in renderer_server_test
#1433
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Previously,
RendererServer/RendererClientused withinrenderer_server_testwere relying on the production service name, which could lead to test failures if a realmozc_rendererprocess was running.In order to avoid such conflicts, this commit modifies the test to use a unique service name for testing as follows:
RendererServeris now responsible for generating a random service name when instantiated viaRendererServer::CreateForTesting().RendererServernow exposes its service name viaGetServiceName()method.RendererClient::CreateForTesting()now takes a service name as an argument, which closes the loop for using the same unique service name in tests.This is anyway only for fixing a test. There must be no observable change in production code.
Closes #1421.
Issue IDs
//renderer:renderer_server_testfails whenmozc_rendereris already running in Windows #1421Steps to test new behaviors (if any)
Mozc64.msiand install it.bazelisk test --config oss_windows -c dbg //renderer:renderer_server_test --nocache_test_results --test_output=streamed