Skip to content

Commit

Permalink
Fixing the flaky tests and adding change logs
Browse files Browse the repository at this point in the history
Signed-off-by: Indrajit Banerjee <banerind@amazon.com>
  • Loading branch information
cenation07 committed Aug 9, 2023
1 parent 6a443fc commit cb72ba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Replace the deprecated IndexReader APIs with new storedFields() & termVectors() ([#7792](https://github.com/opensearch-project/OpenSearch/pull/7792))
- [Remote Store] Restrict user override for remote store index level settings ([#8812](https://github.com/opensearch-project/OpenSearch/pull/8812))
- Removed blocking wait in TransportGetSnapshotsAction which was exhausting generic threadpool ([#8377](https://github.com/opensearch-project/OpenSearch/pull/8377))
- Fixed Flaky test testTransportGetSnapshotsAction ([#9189](https://github.com/opensearch-project/OpenSearch/pull/9189))

### Deprecated

Expand Down Expand Up @@ -129,4 +130,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Security

[Unreleased 3.0]: https://github.com/opensearch-project/OpenSearch/compare/2.x...HEAD
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.10...2.x
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.10...2.x
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public void testTransportGetSnapshotsAction() {

String repoName = "repo";
final String[] snapshotsList = { "snapshot-1" };
final String[] indexList = { "index-1", "index-2" };
final String index = "index-1";
final int shards = randomIntBetween(1, 10);

TestClusterNodes.TestClusterNode clusterManagerNode = testClusterNodes.currentClusterManager(
Expand All @@ -808,7 +808,6 @@ public void testTransportGetSnapshotsAction() {

final StepListener<CreateSnapshotResponse> createSnapshotResponseStepListener = new StepListener<>();
final String snapshot = snapshotsList[0];
final String index = indexList[0];
continueOrDie(
createRepoAndIndex(repoName, index, shards),
createSnapshotResponse -> client().admin()
Expand All @@ -828,11 +827,10 @@ public void testTransportGetSnapshotsAction() {
assertNotNull("Snapshot list should not be null", repoSnapshotResponse.getSnapshots());
assertThat(repoSnapshotResponse.getSnapshots(), hasSize(1));
List<SnapshotInfo> snapshotInfos = repoSnapshotResponse.getSnapshots();
for (SnapshotInfo snapshotInfo : snapshotInfos) {
assertEquals(SnapshotState.SUCCESS, snapshotInfo.state());
assertEquals(0, snapshotInfo.failedShards());
assertTrue(Arrays.stream(snapshotsList).anyMatch(snapshotInfo.snapshotId().getName()::equals));
}
SnapshotInfo snapshotInfo = snapshotInfos.get(0);
assertEquals(SnapshotState.SUCCESS, snapshotInfo.state());
assertEquals(0, snapshotInfo.failedShards());
assertTrue(snapshotInfo.snapshotId().getName().equals(snapshotsList[0]));
}, exception -> { throw new AssertionError(exception); }));
});
}
Expand Down

0 comments on commit cb72ba5

Please sign in to comment.