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 flaky test NRTReplicationEngineTests.testPreserveLatestCommit #9378

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Aug 15, 2023

Description

Fix flaky test NRTReplicationEngineTests.testPreserveLatestCommit.
This test occasionally failed when the primary's engine performed a flush and merge behind the scenes. The test would assert against a specific refCount on committed files with a value of 2 - one for being part of the replica's latest commit and one for being active on the reader. With the unexpected merge, the files will not be part of the latest infos on the reader but still be part of the replica's latest commit point, leaving the files referenced once. I've changed this to instead assert referenced vs unreferenced instead of the specific refCount so that the test can handle the random merges. Further cleaned this up so assertions include a refCount check and to validate the files exist in the directory.

I've run this ~5k times now without failure, was able to repro before this every 100-200 runs.

Related Issues

Resolves #9356

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:

Checks if related components are compatible with change b58bec4

Incompatible components

Incompatible components: [https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/security-analytics.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.SearchTimeoutIT.testSimpleTimeout {p0={"search.concurrent_segment_search.enabled":"true"}}

@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #9378 (6b4b17f) into main (4114009) will decrease coverage by 0.02%.
Report is 6 commits behind head on main.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #9378      +/-   ##
============================================
- Coverage     71.19%   71.17%   -0.02%     
+ Complexity    57455    57451       -4     
============================================
  Files          4777     4777              
  Lines        270712   270712              
  Branches      39566    39566              
============================================
- Hits         192729   192690      -39     
- Misses        61782    61783       +1     
- Partials      16201    16239      +38     

see 493 files with indirect coverage changes

@Poojita-Raj
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

* **RESULT:** UNSTABLE ❕

* **TEST FAILURES:**
      1 org.opensearch.search.SearchTimeoutIT.testSimpleTimeout {p0={"search.concurrent_segment_search.enabled":"true"}}
* **URL:** https://build.ci.opensearch.org/job/gradle-check/22854/

* **CommitID:** [6b4b17f](https://github.com/opensearch-project/OpenSearch/commit/6b4b17f75fd47780ccf1e7d769845de6792ef400)
  Please review all [flaky tests](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Mentioned under cancellation failures here: #7357

@mch2 mch2 added the backport 2.x Backport to 2.x branch label Aug 16, 2023
@mch2 mch2 merged commit 8255050 into opensearch-project:main Aug 16, 2023
@mch2 mch2 deleted the nrtengine branch August 16, 2023 17:34
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 16, 2023
)

Signed-off-by: Marc Handalian <[email protected]>
(cherry picked from commit 8255050)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mch2 pushed a commit that referenced this pull request Aug 16, 2023
) (#9400)

(cherry picked from commit 8255050)

Signed-off-by: Marc Handalian <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
austintlee pushed a commit to austintlee/OpenSearch that referenced this pull request Aug 25, 2023
kkmr pushed a commit to kkmr/OpenSearch that referenced this pull request Aug 28, 2023
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]org.opensearch.index.engine.NRTReplicationEngineTests.testPreserveLatestCommit
3 participants