Use unique service names in renderer_server_test#1433
Open
yukawa wants to merge 1 commit intogoogle:masterfrom
Open
Use unique service names in renderer_server_test#1433yukawa wants to merge 1 commit intogoogle:masterfrom
renderer_server_test#1433yukawa wants to merge 1 commit intogoogle:masterfrom
Conversation
renderer_server_testrenderer_server_test
Previously, RendererServer/RendererClient used within
renderer_server_test were relying on the production service name, which
could lead to test failures if a real mozc_renderer process was running.
In order to avoid such conflicts, this commit modifies the test to use a
unique service name for testing as follows:
- RendererServer is now responsible for generating a random service
name when instantiated via RendererServer::CreateForTesting().
- RendererServer now exposes its service name via GetServiceName()
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 google#1421.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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