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

[Flaky Test] Setting the response before latch countdown #13118

Merged

Conversation

rajiv-kv
Copy link
Contributor

@rajiv-kv rajiv-kv commented Apr 8, 2024

Description

Fixes flaky test AdmissionForClusterManagerIT#testAdmissionControlResponseStatus

The test waits for the response on the latch waitForResponse. Since the latch was count down before setitng the response from the client, the waiting thread read null response causing it fail on NPE

Related Issues

Resolves #13045

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.

…es not encounter null

Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com>
Copy link
Contributor

github-actions bot commented Apr 8, 2024

Compatibility status:

Checks if related components are compatible with change cfdc6dd

Incompatible components

Skipped components

Compatible components

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

Copy link
Contributor

github-actions bot commented Apr 8, 2024

✅ Gradle check result for cfdc6dd: SUCCESS

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.43%. Comparing base (b15cb0c) to head (cfdc6dd).
Report is 139 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #13118      +/-   ##
============================================
+ Coverage     71.42%   71.43%   +0.01%     
- Complexity    59978    60404     +426     
============================================
  Files          4985     5027      +42     
  Lines        282275   284580    +2305     
  Branches      40946    41215     +269     
============================================
+ Hits         201603   203296    +1693     
- Misses        63999    64429     +430     
- Partials      16673    16855     +182     

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

@deshsidd
Copy link
Contributor

deshsidd commented Apr 8, 2024

Can you please add some notes on why the current change fixed the flaky test and how did you validate this? @rajiv-kv

@rajiv-kv
Copy link
Contributor Author

rajiv-kv commented Apr 9, 2024

Can you please add some notes on why the current change fixed the flaky test and how did you validate this? @rajiv-kv

Can you please add some notes on why the current change fixed the flaky test and how did you validate this? @rajiv-kv

https://github.com/opensearch-project/OpenSearch/pull/13118/files#diff-67b5509b161a32e0b4d6f7c13b299091adb6fd8f970642abc34cd1155f471b84R181

Can you please add some notes on why the current change fixed the flaky test and how did you validate this? @rajiv-kv

Updated the description @deshsidd . I was able to reproduce this locally by introducing Thread.sleep() between the two lines setResponse and countDown.

@shwetathareja shwetathareja merged commit f1228e9 into opensearch-project:main Apr 30, 2024
66 of 126 checks passed
finnegancarroll pushed a commit to finnegancarroll/OpenSearch that referenced this pull request May 10, 2024
…es not encounter null (opensearch-project#13118)

Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com>
deshsidd pushed a commit to deshsidd/OpenSearch that referenced this pull request May 17, 2024
…es not encounter null (opensearch-project#13118)

Signed-off-by: Rajiv Kumar Vaidyanathan <rajivkv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Cluster Manager flaky-test Random test failure that succeeds on second run skip-changelog
Projects
Status: ✅ Done
5 participants