Skip to content

Fix port assignment and discovery in tests #33675

@DaveCTurner

Description

@DaveCTurner

Today when configuring nodes for tests we use a variety of mechanisms to ensure that they can find each other and form a cluster. At least one of these mechanisms is racy, leading to occasional test failures (#29244), and few of them implement our documented recommendation:

that the unicast hosts list be maintained as the list of master-eligible nodes in the cluster.

The main obstacle to fixing this was the difficulty of dynamically configuring the unicast hosts list in tests.

In the REST tests, we currently start up one seed node and then have this node as the single host in all other nodes' unicast lists, but this means that the cluster can sometimes form without the seed node knowing about it, and it then cannot ping any of the other nodes to join. Unfortunately these tests include BWC ones so we can only reasonably make this change in master once 6.5 is released, or else we will be trying to configure nodes that do not natively support file-based discovery.

The racy one is the AbstractDisruption test case, which attempts to find a free port by binding to it, then releasing it, and then telling the node to use that, and for some reason port 30210 is occasionally in use by something else. It really does seem to be just this port that causes issues, and we don't want to backport all this work to 5.6, but we do want to avoid test failures like this in 5.6, so let's just avoid this particular port in that branch.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions