-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Extract cluster management for integration tests into JUnit test rule out of OpenSearchIntegTestCase #11877
Conversation
Compatibility status:Checks if related components are compatible with change 359e5c6 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/cross-cluster-replication.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git] |
❌ Gradle check result for 6912b3c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 97f4803: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 1739955: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 1739955: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 1739955: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❕ Gradle check result for 1739955: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #11877 +/- ##
============================================
- Coverage 71.38% 71.36% -0.03%
- Complexity 59354 59425 +71
============================================
Files 4923 4923
Lines 279095 279178 +83
Branches 40559 40581 +22
============================================
- Hits 199228 199222 -6
- Misses 63292 63442 +150
+ Partials 16575 16514 -61 ☔ View full report in Codecov by Sentry. |
❌ Gradle check result for 37c6bcf: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 22d3199: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for e428d4c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for e428d4c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for e428d4c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❕ Gradle check result for e428d4c: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
done |
Signed-off-by: Andriy Redko <[email protected]>
❕ Gradle check result for 2bef064: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
test/framework/src/main/java/org/opensearch/test/OpenSearchTestClusterRule.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @reta, in general I think this is great and a better way to structure the test logic within the JUnit framework.
❕ Gradle check result for 359e5c6: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
@peternied how does it look to you? |
Thanks for checking in @reta I don't have time for a second pass today, but I'm not concerned about merging with @andrross 's approval. I'll create issues or a follow up PR if there is anything I'd like to see addressed. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-11877-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c267c5affa52bb3d176b81f87c9175090f7469e5
# Push it to GitHub
git push --set-upstream origin backport/backport-11877-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
… out of OpenSearchIntegTestCase (opensearch-project#11877) * Extract cluster management for integration tests into JUnit test rule out of OpenSearchIntegTestCase Signed-off-by: Andriy Redko <[email protected]> * Branched off parametrized tests into static / dynamic settings flavors Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> * Refactor internalCluster() method to return an Optional value Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]> (cherry picked from commit c267c5a)
… out of OpenSearchIntegTestCase (#11877) (#11941) * Extract cluster management for integration tests into JUnit test rule out of OpenSearchIntegTestCase Signed-off-by: Andriy Redko <[email protected]> * Branched off parametrized tests into static / dynamic settings flavors Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> * Refactor internalCluster() method to return an Optional value Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]> (cherry picked from commit c267c5a)
@reta seems like we are not running all parameter cases of a parameter factory when cluster scope is default or SCOPE.SUITE. Instead we are only running the first case of parameter factory multiple times (second case is missing). Example Use CaseIn above example, when we run test class, we are only running the first case of So when same test method tries to run with second/different parameters, the node settings are never overridden again with new parameter values because the cluster is already present. Node settings are overridden only when new cluster is built. So this way test is running again with same settings passed in first parameter values. Current flow of test runs with multiple parameters and scope set to SCOPE.SUITE or default:Build Cluster -> run testMethod1() with param1 -> run testMethod2() with param1 -> run testMethod1() with param1 -> run testMethod2() with param1 -> Remove cluster Instead correct flow for using static settings should be :Build Cluster -> run testMethod1() with param1 -> run testMethod2() with param1 -> Remove Cluster -> Build cluster again -> run testMethod1() with param2 -> run testMethod2() with param2-> Remove cluster |
@Rishikesh1159 thanks for bringing it up
The cluster should be shut down once the change of parameters is detected, so the new node settings should be picked up, I will double check shortly |
@Rishikesh1159 |
@andrross Yes We have three type of scopes:
The conditional check was only detecting 3rd type of scope. But majority of tests are 1st type including this example (Use Case) |
@andrross the @Rishikesh1159's explanation (#11877 (comment)) is correct, I was thinking exactly the way you described but it turned out |
thanks @Rishikesh1159, when I was debugging one of the tests today I realized that even with concurrent search parameter set to true, it wasnt taking the concurrent search path. This explains on why it was the case. |
Sorry about that @neetikasinghal , the issue slipped in |
… out of OpenSearchIntegTestCase (opensearch-project#11877) * Extract cluster management for integration tests into JUnit test rule out of OpenSearchIntegTestCase Signed-off-by: Andriy Redko <[email protected]> * Branched off parametrized tests into static / dynamic settings flavors Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> * Refactor internalCluster() method to return an Optional value Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]>
… out of OpenSearchIntegTestCase (opensearch-project#11877) * Extract cluster management for integration tests into JUnit test rule out of OpenSearchIntegTestCase Signed-off-by: Andriy Redko <[email protected]> * Branched off parametrized tests into static / dynamic settings flavors Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> * Refactor internalCluster() method to return an Optional value Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]>
… out of OpenSearchIntegTestCase (opensearch-project#11877) * Extract cluster management for integration tests into JUnit test rule out of OpenSearchIntegTestCase Signed-off-by: Andriy Redko <[email protected]> * Branched off parametrized tests into static / dynamic settings flavors Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> * Refactor internalCluster() method to return an Optional value Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
Extract cluster management for integration tests into JUnit test rules our of OpenSearchIntegTestCase. @neetikasinghal this is follow up on the work you have done for parameterizing integration test cases. We now have removed the test cluster management logic from the
OpenSearchIntegTestCase
to dedicated JUnit rule, which gave us an opportunity implement two favours of cluster setting parametrization:ParameterizedDynamicSettingsOpenSearchIntegTestCase
(was implemented byParameterizedOpenSearchIntegTestCase
): the test clusters settings are applied dynamically before each test methodParameterizedStaticSettingsOpenSearchIntegTestCase
(was not supported): the clusters settings are applied at startup timeCC @andrross should open up the road for parameterized segment replication test cases
Related Issues
N/A
Check List
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.