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 ClusterMetadataManifestTests #9728

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

r1walz
Copy link
Contributor

@r1walz r1walz commented Sep 4, 2023

Description

We're comparing for unequal manifests but randomBoolean() has a high probability of getting clashed because of a small search-space, making test flaky. Let's limit randomization here.

Related Issues

Resolves #9688

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.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Compatibility status:

Checks if related components are compatible with change 7cd5355

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.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/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

Merging #9728 (55fec3b) into main (19a13f0) will increase coverage by 0.05%.
Report is 4 commits behind head on main.
The diff coverage is 76.65%.

@@             Coverage Diff              @@
##               main    #9728      +/-   ##
============================================
+ Coverage     71.14%   71.20%   +0.05%     
- Complexity    57973    58070      +97     
============================================
  Files          4825     4827       +2     
  Lines        273348   273539     +191     
  Branches      39841    39858      +17     
============================================
+ Hits         194473   194767     +294     
+ Misses        62523    62447      -76     
+ Partials      16352    16325      -27     
Files Changed Coverage Δ
...on/admin/indices/shrink/TransportResizeAction.java 47.72% <0.00%> (-19.99%) ⬇️
...ofile/aggregation/AggregationProfileBreakdown.java 0.00% <ø> (ø)
...rch/search/profile/ContextualProfileBreakdown.java 75.00% <50.00%> (-25.00%) ⬇️
...search/profile/query/AbstractQueryProfileTree.java 76.92% <76.92%> (ø)
...arch/profile/query/ConcurrentQueryProfileTree.java 88.88% <88.88%> (ø)
...profile/query/ConcurrentQueryProfileBreakdown.java 98.59% <98.51%> (-1.41%) ⬇️
...in/cluster/remotestore/stats/RemoteStoreStats.java 96.24% <100.00%> (ø)
...rg/opensearch/index/remote/RemoteSegmentStats.java 98.24% <100.00%> (ø)
...ensearch/search/internal/ContextIndexSearcher.java 73.83% <100.00%> (+0.30%) ⬆️
...ch/search/profile/AbstractInternalProfileTree.java 98.11% <100.00%> (+0.03%) ⬆️
... and 4 more

... and 457 files with indirect coverage changes

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

As I understand this test, the manifest is suppose to be mutated during this step, and if it isn't mutated because the value is set to the same value that already was set the test will fail, seems like there was a 1/8 (if the committed value is selected) + 1/2 (if the value was !currentValue) chance this test would fail without this change.

However, this test doesn't seem like a good candidate for randomness. What do you think about remove the random number generation and make 8 sub test cases around each of these fields with deterministic start and end states.

@r1walz
Copy link
Contributor Author

r1walz commented Sep 4, 2023

@peternied : I'm aligned on further dividing the test cases for each attribute. @soosinha, your thoughts?

@soosinha
Copy link
Member

soosinha commented Sep 5, 2023

Dividing the test for each field would give better coverage. I am fine with the suggestion.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Compatibility status:

Checks if related components are compatible with change 37dfa0d

Incompatible components

Incompatible components: [https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/neural-search.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, 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/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.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/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT:
  • URL:
  • CommitID: ae5cea3
    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?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Compatibility status:

Checks if related components are compatible with change ae5cea3

Incompatible components

Incompatible components: [https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/neural-search.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@dblock
Copy link
Member

dblock commented Sep 5, 2023

@r1walz please take a look at the gradle failures

@r1walz
Copy link
Contributor Author

r1walz commented Sep 5, 2023

@dblock Jenkins was down earlier. I've retriggered the CI actions. Can you please add skip-changelog tag? Thanks.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

@r1walz
Copy link
Contributor Author

r1walz commented Sep 5, 2023

#9776 Flaky test. Other gradle check is failing because of OOM issues.

We're comparing for unequal manifests but randomBoolean() has a high
probability of getting clashed because of a small search-space, making
test flaky. Let's limit randomization here.

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Compatibility status:

Checks if related components are compatible with change 55fec3b

Incompatible components

Incompatible components: [https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/reporting.git]

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Gradle Check (Jenkins) Run Completed with:

@RS146BIJAY
Copy link
Contributor

RS146BIJAY commented Sep 6, 2023

@r1walz Is there a plan to merge this PR? Seems it is failing continously.

@sachinpkale sachinpkale merged commit 6fe9388 into opensearch-project:main Sep 6, 2023
12 checks passed
@sachinpkale sachinpkale added the backport 2.x Backport to 2.x branch label Sep 6, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 6, 2023
We're comparing for unequal manifests but randomBoolean() has a high
probability of getting clashed because of a small search-space, making
test flaky. Let's limit randomization here.

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
(cherry picked from commit 6fe9388)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
sachinpkale pushed a commit that referenced this pull request Sep 6, 2023
We're comparing for unequal manifests but randomBoolean() has a high
probability of getting clashed because of a small search-space, making
test flaky. Let's limit randomization here.


(cherry picked from commit 6fe9388)

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
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>
@r1walz r1walz deleted the fix-confetti branch September 6, 2023 22:26
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
We're comparing for unequal manifests but randomBoolean() has a high
probability of getting clashed because of a small search-space, making
test flaky. Let's limit randomization here.

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
We're comparing for unequal manifests but randomBoolean() has a high
probability of getting clashed because of a small search-space, making
test flaky. Let's limit randomization here.

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
Signed-off-by: Ivan Brusic <ivan.brusic@flocksafety.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
We're comparing for unequal manifests but randomBoolean() has a high
probability of getting clashed because of a small search-space, making
test flaky. Let's limit randomization here.

Signed-off-by: Rohit Ashiwal <rashiwal@amazon.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.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.

[BUG] ClusterMetadataManifestTests testClusterMetadataManifestSerializationEqualsHashCode seems flaky
6 participants