-
Notifications
You must be signed in to change notification settings - Fork 25k
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
TESTS: Use File Based Discovery in REST Tests #34560
TESTS: Use File Based Discovery in REST Tests #34560
Conversation
original-brownbear
commented
Oct 17, 2018
- For 7.0 use file based discovery in REST tests
- Relates Fix port assignment and discovery in tests #33675
* For 7.0 use file based discovery in REST tests * Relates elastic#33675
Pinging @elastic/es-distributed |
@DaveCTurner I hope this is what we want here :) |
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.
File-based discovery is available without a plugin in 6.x
so I think once 6.5.0 is released we can do this (in master
) without worrying about versions. We should wait.
Also, with this change I think the whole concept of a "seed" node can go away.
Also, with this change I think we can undo the changes in #27344 and go back to a more reasonable setting for minimum_master_nodes
.
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy
Outdated
Show resolved
Hide resolved
I'm not sure - how easy is it to install a plugin for these tests? If it's easy, I think we should try and make an equivalent change to |
@DaveCTurner I think there is logic that helps with installing plugins in this code but I would need to research this a little to see how tricky it is to actually use it. |
Yes. |
Wrong again! I thought we tested |
@DaveCTurner no worries :) I'm back on it then |
@DaveCTurner alright, that was a confusing one (sorry for missing that |
@DaveCTurner argh :D see Jenkins log ... we do run against 6.4.x-snapshot => back to waiting it out here? :) |
@DaveCTurner alright back to plan A as discussed: Made it only use file based discovery for 6.5+ now. Should be good for another review :) |
@DaveCTurner finally green :) |
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.
Neat! Can we lose the start-one-node-then-start-the-rest pattern for 6.5.0+ clusters? I asked for a handful of minor changes too.
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy
Outdated
Show resolved
Hide resolved
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy
Outdated
Show resolved
Hide resolved
|
||
nodes.forEach { node -> | ||
Collection<String> unicastHosts = new HashSet<>() | ||
nodes.forEach { otherNode -> |
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.
Does this need to be nested? Could we calculate it once up-front and then write all the hosts files?
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.
Wouldn't we want to not have self-references in these (I guess it doesn't matter), but in that case we actually need additional code to account for the one self-reference that will return null
in that loop.
I just figured this was the shortest solution? :)
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.
Ok, more seed node weirdness. I think you should up-front call unicastTransportUri(node, null, project.ant)
in order to read the transport address of every node, and then put all of them into all of the unicast_hosts.txt
files. It's normal for all the nodes to have the same list of unicast hosts, even though one of them refers to itself.
@@ -703,6 +724,7 @@ class ClusterFormationTasks { | |||
} | |||
} | |||
} | |||
|
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.
You could make this PR 4% smaller by removing this line again ;)
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.
(copied from previous review): Also, with this change I think we can undo the changes in #27344 and go back to a more reasonable setting for minimum_master_nodes.
@DaveCTurner alright all handled I think: The waiting for the seed node was easy to fix functionally in 391a8a6 (just don't add the task dependency to new version nodes). I didn't refactor the code for it a great deal because of the last point below The precomputing the unicast hosts and setting The situation with the minimum master nodes setting I don't think I can easily fix here. For the BwC nodes this will still spell trouble because we're still using the old way of setting the unicast hosts to the first node for those and nothing has changed for them? => I didn't make any changes to that and also figured there wasn't too much point in a larger code change to separate the paths for older than |
Jenkins test this |
…of masters lowered in 6.5+
@DaveCTurner looks like GH finally refreshed :) This should be good for another review now. |
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'm happy with this (except the longer timeout, see comment). However CI is not. We looked into it together and suspected that there's something wrong with how the discovery plugin tests work. If so, and if it fixes it, I'd be ok with reinstating the discovery.zen.ping.unicast.hosts
lists in those cases and then following up with a proper fix as a separate PR.
@@ -131,7 +137,7 @@ class ClusterConfiguration { | |||
* condition is executed. | |||
*/ | |||
@Input | |||
int nodeStartupWaitSeconds = 30 | |||
int nodeStartupWaitSeconds = 120 |
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'd rather not do this - I think there's something wrong with the discovery plugin tests.
@DaveCTurner it seems the normal discovery mechanism interfering (or rather it not doing so) wasn't the issue here.
Looking into the changed dependency order now. |
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
* For `6.5+` use file based discovery in REST tests * Relates #33675
* For `6.5+` use file based discovery in REST tests * Relates elastic#33675
* For `6.5+` use file based discovery in REST tests * Relates #33675