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

Made the BulkRetryStrategyTests less reliant on implementation specifics from OpenSearch #1346

Conversation

dlvenable
Copy link
Member

@dlvenable dlvenable commented Apr 28, 2022

Description

These changes are to help support using OpenSearch 2.0.0-RC1 (#1311) in Data Prepper.

  • The tests were creating real objects when they could use mocks instead. These mocks work for both OpenSearch 1 and 2.
  • The tests relied on the specific implementation of DocWriteRequest.toString(). This change uses mocking to decouple that.
  • Use JUnit 5

I've tested this code locally when compiling both against OpenSearch 1.1.0 (current compile-time version) and 2.0.0-RC1.

Issues Resolved

N/A

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…rom the the implementation of the bulk client in OpenSearch. This change works for both OpenSearch 1 and 2. Updated to use JUnit 5 as well, and some other refactoring.

Signed-off-by: David Venable <[email protected]>
@dlvenable dlvenable requested a review from a team as a code owner April 28, 2022 22:46
dinujoh
dinujoh previously approved these changes Apr 29, 2022
chenqi0805
chenqi0805 previously approved these changes Apr 29, 2022
Copy link
Collaborator

@chenqi0805 chenqi0805 left a comment

Choose a reason for hiding this comment

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

Thanks for the refining work! Just one inline comment


@Before
@BeforeEach
public void metricsInit() {
MetricsTestUtil.initMetrics();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggest put it in the setUp instead of another @beforeeach method

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @chenqi0805 ! I pushed a change for it. Please re-review.

@dlvenable dlvenable dismissed stale reviews from chenqi0805 and dinujoh via 833e0a6 April 29, 2022 15:46
@dlvenable dlvenable merged commit 512ffcc into opensearch-project:main Apr 29, 2022
@dlvenable dlvenable deleted the bulk-retry-tests-decouple-from-os-specifics branch May 17, 2022 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants