Skip to content

Fix randomization in MlNodeShutdownIT #77281

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@ public void testJobsVacateShuttingDownNode() throws Exception {
});

// Call the shutdown API for the chosen node.
final SingleNodeShutdownMetadata.Type type = randomFrom(SingleNodeShutdownMetadata.Type.values());
final String targetNodeName = type == SingleNodeShutdownMetadata.Type.REPLACE ? randomAlphaOfLengthBetween(10, 20) : null;
client().execute(
PutShutdownNodeAction.INSTANCE,
new PutShutdownNodeAction.Request(
nodeIdToShutdown.get(),
randomFrom(SingleNodeShutdownMetadata.Type.values()),
"just testing",
null,
null)
targetNodeName)
).actionGet();

// Wait for the desired end state of all 6 jobs running on nodes that are not shutting down.
Expand Down Expand Up @@ -144,14 +146,15 @@ public void testCloseJobVacatingShuttingDownNode() throws Exception {
});

// Call the shutdown API for the chosen node.
final SingleNodeShutdownMetadata.Type type = randomFrom(SingleNodeShutdownMetadata.Type.values());
final String targetNodeName = type == SingleNodeShutdownMetadata.Type.REPLACE ? randomAlphaOfLengthBetween(10, 20) : null;
client().execute(
PutShutdownNodeAction.INSTANCE,
new PutShutdownNodeAction.Request(
nodeIdToShutdown.get(),
randomFrom(SingleNodeShutdownMetadata.Type.values()),
nodeIdToShutdown.get(), type,
"just testing",
null,
null)
targetNodeName)
)
.actionGet();

Expand Down