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 tests in CopyProcessorTests #12885

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

gaobinlong
Copy link
Collaborator

@gaobinlong gaobinlong commented Mar 24, 2024

Description

When testing CopyProcessorTests#testCopyWithRemoveSource(), even though we use random() to generate field names, but there's a probability that the target field's name conflicts with the existing fields(then the error target field [] already exists will be thrown), we need to have a better way to make sure that the target field's name never exists in the document.

Another method testCopyExistingField() also has the same issue.

Related Issues

#12884

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Copy link
Contributor

github-actions bot commented Mar 24, 2024

Compatibility status:

Checks if related components are compatible with change 0d79235

Incompatible components

Skipped components

Compatible components

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

Copy link
Contributor

❕ Gradle check result for 8e87efb: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreStatsIT.testNonZeroPrimaryStatsOnNewlyCreatedIndexWithZeroDocs

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Mar 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.34%. Comparing base (b15cb0c) to head (2c039d7).
Report is 93 commits behind head on main.

❗ Current head 2c039d7 differs from pull request most recent head 0d79235. Consider uploading reports for the commit 0d79235 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12885      +/-   ##
============================================
- Coverage     71.42%   71.34%   -0.08%     
- Complexity    59978    60254     +276     
============================================
  Files          4985     5011      +26     
  Lines        282275   283675    +1400     
  Branches      40946    41117     +171     
============================================
+ Hits         201603   202399     +796     
- Misses        63999    64554     +555     
- Partials      16673    16722      +49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

❌ Gradle check result for 955a84a: 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?

Copy link
Contributor

✅ Gradle check result for 2c039d7: SUCCESS

@gaobinlong
Copy link
Collaborator Author

@reta ,could you help to review this PR, thank you!

Copy link
Contributor

❕ Gradle check result for 0d79235: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.action.admin.cluster.node.tasks.ResourceAwareTasksTests.testTaskResourceTrackingDuringTaskCancellation

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@reta reta merged commit 3b10a06 into opensearch-project:main Mar 26, 2024
31 of 33 checks passed
@reta reta added the backport 2.x Backport to 2.x branch label Mar 26, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 26, 2024
* Fix flaky test CopyProcessorTests#testCopyWithRemoveSource

Signed-off-by: Gao Binlong <[email protected]>

* Remove an existing field to get a non-existing field name

Signed-off-by: Gao Binlong <[email protected]>

* Add a new randomFieldName method

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
(cherry picked from commit 3b10a06)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Mar 26, 2024
* Fix flaky test CopyProcessorTests#testCopyWithRemoveSource



* Remove an existing field to get a non-existing field name



* Add a new randomFieldName method



---------


(cherry picked from commit 3b10a06)

Signed-off-by: Gao Binlong <[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>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Fix flaky test CopyProcessorTests#testCopyWithRemoveSource

Signed-off-by: Gao Binlong <[email protected]>

* Remove an existing field to get a non-existing field name

Signed-off-by: Gao Binlong <[email protected]>

* Add a new randomFieldName method

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
harshavamsi pushed a commit to harshavamsi/OpenSearch that referenced this pull request Apr 29, 2024
* Fix flaky test CopyProcessorTests#testCopyWithRemoveSource

Signed-off-by: Gao Binlong <[email protected]>

* Remove an existing field to get a non-existing field name

Signed-off-by: Gao Binlong <[email protected]>

* Add a new randomFieldName method

Signed-off-by: Gao Binlong <[email protected]>

---------

Signed-off-by: Gao Binlong <[email protected]>
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