Skip to content
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

Fix SearchableSnapshotsLicenseIntegTests.testShardAllocationOnInvalidLicense #72528

Merged
merged 1 commit into from
May 3, 2021
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 @@ -89,6 +89,9 @@ public void createAndMountSearchableSnapshot() throws Exception {

assertAcked(client().execute(DeleteLicenseAction.INSTANCE, new DeleteLicenseRequest()).get());
assertAcked(client().execute(PostStartBasicAction.INSTANCE, new PostStartBasicRequest()).get());

ensureClusterSizeConsistency();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I think we can do it in one line with ensureStableCluster(cluster().size())? That seems like it's all we need here? Looks like this is a retry on the master node request I guess? (though there's no master fail-over, but maybe a connection got dropped for some reason?) ... That's my best guess :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged as is, I wanted to ensure no pending tasks on all nodes with the same cluster state everywhere.

And yes, retries might explain this. We'll see if that happens again

ensureClusterStateConsistency();
}

public void testMountRequiresLicense() {
Expand Down Expand Up @@ -150,6 +153,10 @@ public void testShardAllocationOnInvalidLicense() throws Exception {
client().admin().cluster().prepareHealth(indexName).get().getIndices().get(indexName).getStatus()
)
);

waitNoPendingTasksOnAll();
ensureClusterStateConsistency();

// add a valid license again
// This is a bit of a hack in tests, as we can't readd a trial license
// We force this by clearing the existing basic license first
Expand All @@ -158,6 +165,10 @@ public void testShardAllocationOnInvalidLicense() throws Exception {
.metadata(Metadata.builder(currentState.metadata()).removeCustom(LicensesMetadata.TYPE).build())
.build()
);

waitNoPendingTasksOnAll();
ensureClusterStateConsistency();

PostStartTrialRequest startTrialRequest = new PostStartTrialRequest().setType(License.LicenseType.TRIAL.getTypeName())
.acknowledge(true);
PostStartTrialResponse resp = client().execute(PostStartTrialAction.INSTANCE, startTrialRequest).get();
Expand Down