-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Don't start a new node in InternalTestCluster#getClient
#127318
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
Conversation
This method would default to starting a new node when the cluster was empty. This is pretty trappy as `getClient()` (or things like `getMaster()` that depend on `getClient()`) don't look at all like something that would start a new node. In any case, the intention of tests is much clearer when they explicitly define a cluster configuration.
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 couldn't really come up with a great way to split this PR up. If it's too much to review, any suggestions for splitting it up are welcome.
@@ -57,7 +57,7 @@ | |||
/** | |||
* An integration test that verifies how different paths/scenarios affect the APM metrics for failure stores. | |||
*/ | |||
@ESIntegTestCase.ClusterScope(numDataNodes = 0, numClientNodes = 0, scope = ESIntegTestCase.Scope.SUITE) | |||
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 1, numClientNodes = 0, supportsDedicatedMasters = false) |
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.
Some tests depend on there being exactly one node in the cluster, which I solved like this.
|
||
import java.util.Collection; | ||
|
||
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0, numClientNodes = 0) |
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.
Some tests didn't actually need any specific cluster configuration.
@@ -33,8 +33,6 @@ private Settings.Builder nodeSettingsBuilder(int nodeOrdinal, Settings otherSett | |||
} | |||
|
|||
public void testClusterRestartWithLicense() throws Exception { | |||
wipeAllLicenses(); |
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.
Wiping the licenses before the test starts doesn't make sense if we start with an empty cluster (i.e. no nodes).
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
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.
LGTM nice work
This method would default to starting a new node when the cluster was empty. This is pretty trappy as
getClient()
(or things likegetMaster()
that depend ongetClient()
) don't look at all like something that would start a new node.In any case, the intention of tests is much clearer when they explicitly define a cluster configuration.