[improve][testing] Add client/admin builders and temporary directory support for testing standalone service - #26807
Open
hohoho1886 wants to merge 12 commits into
Open
hohoho1886 wants to merge 12 commits into
hohoho1886 wants to merge 12 commits into
Conversation
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.
Fixes #10473
Motivation
This PR aims to make testing with
PulsarStandalonemore convenient because:PulsarStandaloneBuilder, there are no helper methods to create a PulsarClient or PulsarAdmin connected to the started service.Modifications
buildClient()andbuildAdmin()methodsclose()(which should be called at the end of the test) ofPulsarStandalonestartBookieWithMetadataStore()to start the service without.conffile. I think this is safe in production becauseelsebranch is never executed as long as.conffile is provided (which is the case in production)Otherwise, I am ready to address any requested changes.
Verifying this change
(Please pick either of the following options)
This change added tests and can be verified as follows:
PulsarStandaloneBuilderTest.testStartFromJava, which starts astandalone service from plain Java with a client and check if temporary directory is deleted after the service is closed.
standalone.setNumOfBk(2)to avoid the error of not having enough healthy bookies.Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes