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

[Segment Replication] Wait for segment replication to be completed and marked done before assertion #6370

Conversation

dreamer-89
Copy link
Member

@dreamer-89 dreamer-89 commented Feb 18, 2023

Description

This change fixes the flakyness in testSegmentReplicationStatsResponse happening due to race condition where segment replication does not complete before fetching SegmentReplicationStatsResponse response. The change waits for segment replication to complete before assertions. The change also removes deprecated assertThat.

Sample unstable gradle check: https://build.ci.opensearch.org/job/gradle-check/11323/

Issues Resolved

#5669

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.

…d marked done before assertion

Signed-off-by: Suraj Singh <surajrider@gmail.com>
Signed-off-by: Suraj Singh <surajrider@gmail.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@dreamer-89 dreamer-89 mentioned this pull request Feb 18, 2023
6 tasks
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #6370 (3e40fa9) into main (1540e00) will increase coverage by 0.08%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6370      +/-   ##
============================================
+ Coverage     70.67%   70.75%   +0.08%     
- Complexity    58948    59021      +73     
============================================
  Files          4800     4800              
  Lines        282421   282421              
  Branches      40719    40719              
============================================
+ Hits         199587   199817     +230     
+ Misses        66392    66174     -218     
+ Partials      16442    16430      -12     
Impacted Files Coverage Δ
...gations/bucket/composite/CompositeAggregation.java 15.00% <0.00%> (-80.00%) ⬇️
...pensearch/client/cluster/RemoteConnectionInfo.java 0.00% <0.00%> (-68.30%) ⬇️
...a/org/opensearch/client/cluster/ProxyModeInfo.java 0.00% <0.00%> (-55.00%) ⬇️
...ch/transport/ReceiveTimeoutTransportException.java 50.00% <0.00%> (-50.00%) ⬇️
...cluster/coordination/PendingClusterStateStats.java 20.00% <0.00%> (-48.00%) ⬇️
.../org/opensearch/client/indices/AnalyzeRequest.java 31.00% <0.00%> (-45.00%) ⬇️
...ter/shards/TransportClusterSearchShardsAction.java 53.84% <0.00%> (-43.59%) ⬇️
.../opensearch/client/cluster/RemoteInfoResponse.java 61.53% <0.00%> (-38.47%) ⬇️
...aggregations/bucket/composite/ParsedComposite.java 44.44% <0.00%> (-37.04%) ⬇️
...n/decider/SnapshotInProgressAllocationDecider.java 34.78% <0.00%> (-34.79%) ⬇️
... and 497 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dreamer-89 dreamer-89 added the backport 2.x Backport to 2.x branch label Feb 18, 2023
@dreamer-89 dreamer-89 merged commit eeb149f into opensearch-project:main Feb 19, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-6370-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 eeb149fa03a951b74209d258c6d2d93ee366b087
# Push it to GitHub
git push --set-upstream origin backport/backport-6370-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-6370-to-2.x.

dreamer-89 added a commit to dreamer-89/OpenSearch that referenced this pull request Feb 19, 2023
…d marked done before assertion (opensearch-project#6370)

* [Segment Replication] Wait for segment replication to be completed and marked done before assertion

Signed-off-by: Suraj Singh <surajrider@gmail.com>

* Spotless fix

Signed-off-by: Suraj Singh <surajrider@gmail.com>

---------

Signed-off-by: Suraj Singh <surajrider@gmail.com>
mch2 pushed a commit that referenced this pull request Feb 19, 2023
…d marked done before assertion (#6370) (#6373)

* [Segment Replication] Wait for segment replication to be completed and marked done before assertion



* Spotless fix



---------

Signed-off-by: Suraj Singh <surajrider@gmail.com>
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.

3 participants