Skip to content

Fix testGetSnapshotsMultipleRepos #43993

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
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 @@ -157,6 +157,13 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
MockRepository.Plugin.class);
}

@Override
protected Settings nodeSettings(int nodeOrdinal) {
return Settings.builder().put(super.nodeSettings(nodeOrdinal))
.put(ThreadPool.ESTIMATED_TIME_INTERVAL_SETTING.getKey(), 0) // We have tests that check by-timestamp order
.build();
}

private Settings randomRepoSettings() {
Settings.Builder repoSettings = Settings.builder();
repoSettings.put("location", randomRepoPath());
Expand Down Expand Up @@ -1340,8 +1347,7 @@ public void testGetSnapshotsNoRepos() {
assertTrue(getSnapshotsResponse.getSuccessfulResponses().isEmpty());
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/pull/43993")
public void testGetSnapshotsMultipleRepos() {
public void testGetSnapshotsMultipleRepos() throws Exception {
final Client client = client();

List<String> snapshotList = new ArrayList<>();
Expand Down Expand Up @@ -1370,6 +1376,11 @@ public void testGetSnapshotsMultipleRepos() {
for (int snapshotIndex = 0; snapshotIndex < randomIntBetween(2, 5); snapshotIndex++) {
final String snapshotName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
snapshotList.add(snapshotName);
// Wait for at least 1ms to ensure that snapshots can be ordered by timestamp deterministically
for (final ThreadPool threadPool : internalCluster().getInstances(ThreadPool.class)) {
final long startMillis = threadPool.absoluteTimeInMillis();
assertBusy(() -> assertThat(threadPool.absoluteTimeInMillis(), greaterThan(startMillis)));
}
logger.info("--> create snapshot with index {} and name {} in repository {}", snapshotIndex, snapshotName, repoName);
CreateSnapshotResponse createSnapshotResponse = client.admin()
.cluster()
Expand Down