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

Consume numNodes sent during integTestRemote #1085

Conversation

monusingh-1
Copy link
Collaborator

Description

numNodes parameter was not getting consumed by the integTestRemote gradle task.
numNodes param is used to set isMultiNodeClusterConfiguration which is used to skip tests like reroute.

This change allows numNodes param to be used.

Issues Resolved

[List any issues this PR will resolve]

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

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.

@monusingh-1 monusingh-1 marked this pull request as ready for review July 19, 2023 04:33
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #1085 (f26c4dc) into 2.9 (7d5e071) will decrease coverage by 0.49%.
The diff coverage is n/a.

❗ Current head f26c4dc differs from pull request most recent head 4e91be6. Consider uploading reports for the commit 4e91be6 to get more accurate results

@@             Coverage Diff              @@
##                2.9    #1085      +/-   ##
============================================
- Coverage     76.25%   75.77%   -0.49%     
+ Complexity     1060     1057       -3     
============================================
  Files           141      141              
  Lines          4771     4771              
  Branches        546      546              
============================================
- Hits           3638     3615      -23     
- Misses          782      801      +19     
- Partials        351      355       +4     

see 1 file with indirect coverage changes

build.gradle Outdated
@@ -506,7 +506,7 @@ integTest {
systemProperty "tests.cluster.${cluster.name}.http_hosts", "${-> allHttpSocketURI}"
systemProperty "tests.cluster.${cluster.name}.transport_hosts", "${-> alltransportSocketURI}"
systemProperty "tests.cluster.${cluster.name}.security_enabled", "${-> securityEnabled.toString()}"
systemProperty "tests.cluster.${cluster.name}.total_nodes", "${-> _numNodes.toString()}"
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to change the property name for consume?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I created a unified function to check if multiNodeConfiguration is present

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep the same key as before. isMultiNodeClusterConfiguration can take a cluster name as argument.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@monusingh-1 monusingh-1 force-pushed the use_numnodes_for_integtestRemote branch from e3a4175 to 5b15905 Compare July 19, 2023 05:22
@@ -930,6 +930,9 @@ task integTestRemote (type: RestIntegTestTask) {
systemProperty "tests.cluster.leaderCluster.security_enabled", System.getProperty("security_enabled")

nonInputProperties.systemProperty('tests.integTestRemote', "true")
var numberOfNodes = findProperty('numNodes') as Integer
systemProperty "tests.cluster.followCluster.total_nodes", "${-> numberOfNodes.toString()}"
systemProperty "tests.cluster.leaderCluster.total_nodes", "${-> numberOfNodes.toString()}"
systemProperty "build.dir", "${buildDir}"
Copy link
Collaborator Author

@monusingh-1 monusingh-1 Jul 19, 2023

Choose a reason for hiding this comment

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

For integTestRemote set total_nodes

if(totalLeaderNodes != null && totalFollowerNodes !=null && totalLeaderNodes < "2" && totalFollowerNodes < "2" ) {
return false
}
return true
Copy link
Member

Choose a reason for hiding this comment

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

Why true is the default behaviour here? If the system property is not getting stuck, we'll end up not skipping the tests and thus failing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If integ tests are run locally, we are always setting the property and same with integTest Remote

Copy link
Member

Choose a reason for hiding this comment

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

then let's remove the null check

Copy link
Member

Choose a reason for hiding this comment

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

and add an assertion instead

soosinha
soosinha previously approved these changes Jul 19, 2023
Signed-off-by: monusingh-1 <[email protected]>
@monusingh-1 monusingh-1 enabled auto-merge (squash) July 19, 2023 08:40
@monusingh-1 monusingh-1 merged commit 0f4af64 into opensearch-project:2.9 Jul 19, 2023
@monusingh-1 monusingh-1 deleted the use_numnodes_for_integtestRemote branch November 2, 2023 12:55
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.

4 participants