Skip to content

Commit

Permalink
Update UT for older version
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <[email protected]>
  • Loading branch information
soosinha committed Oct 28, 2024
1 parent 64c813f commit 4bd03a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Workload Management] Fixing Create/Update QueryGroup TransportActions to execute from non-cluster manager nodes ([16422](https://github.com/opensearch-project/OpenSearch/pull/16422))
- Fix flaky test in `testApproximateRangeWithSizeOverDefault` by adjusting totalHits assertion logic ([#16434](https://github.com/opensearch-project/OpenSearch/pull/16434#pullrequestreview-2386999409))
- Revert changes to upload remote state manifest using minimum codec version([#16403](https://github.com/opensearch-project/OpenSearch/pull/16403))
- Use OpenSearch version to deserializat remote custom metadata([#16494](https://github.com/opensearch-project/OpenSearch/pull/16494))
- Use OpenSearch version to deserialize remote custom metadata([#16494](https://github.com/opensearch-project/OpenSearch/pull/16494))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@ public void testGetAsyncWriteRunnable_TemplatesMetadata() throws Exception {
}

public void testGetAsyncReadRunnable_CustomMetadata() throws Exception {
for (Version version : List.of(Version.CURRENT, Version.V_2_15_0, Version.V_2_13_0)) {
verifyCustomMetadataReadForVersion(version);
}
}

private void verifyCustomMetadataReadForVersion(Version version) throws Exception {
Metadata.Custom customMetadata = getCustomMetadata();
String fileName = randomAlphaOfLength(10);
RemoteCustomMetadata customMetadataForDownload = new RemoteCustomMetadata(
Expand All @@ -489,7 +495,7 @@ public void testGetAsyncReadRunnable_CustomMetadata() throws Exception {
CLUSTER_UUID,
compressor,
namedWriteableRegistry,
Version.CURRENT
version
);
when(blobStoreTransferService.downloadBlob(anyIterable(), anyString())).thenReturn(
customMetadataForDownload.customBlobStoreFormat.serialize(customMetadata, fileName, compressor).streamInput()
Expand Down Expand Up @@ -697,4 +703,5 @@ public void testGetUpdatedCustoms() {
assertThat(customsDiff.getUpserts(), is(expectedUpserts));
assertThat(customsDiff.getDeletes(), is(List.of(CustomMetadata1.TYPE)));
}

}

0 comments on commit 4bd03a7

Please sign in to comment.