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

Validate 409s occur when multiple config updates happen simultaneously #3909

Merged

Conversation

prabhask5
Copy link
Contributor

@prabhask5 prabhask5 commented Jan 2, 2024

Description

Added new TenantAsyncActionTest.java file to put api unit tests for the /api/tenants api call- additionally wrote new unit test to test for parallel PUT /tenant/{name} calls, that they successfully return a 409 call and retry the call.

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
    Test fix

  • Why these changes are required?
    There was no test that checked for the behavior mentioned in the linked ticket, so previously we didn't know if the issue still existed or not (it apparently was fixed before), to make sure this doesn't happen again for this particular case, I decided to write a concrete test for it.

  • What is the old behavior before changes and new behavior after changes?
    Test was added, there's no behavior change?

Issues Resolved

Testing

Added new tenant action unit test to test parallel tenant api calls.

Check List

  • New functionality includes testing
  • New functionality has been documented
  • 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.

Signed-off-by: Prabhas Kurapati <[email protected]>
@prabhask5 prabhask5 force-pushed the pk-add-async-tenant-creation-test branch from 0e1549f to e8ea463 Compare January 2, 2024 16:32
Signed-off-by: Prabhas Kurapati <[email protected]>
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (26e62d5) 65.18% compared to head (2408815) 65.56%.
Report is 20 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3909      +/-   ##
==========================================
+ Coverage   65.18%   65.56%   +0.37%     
==========================================
  Files         298      298              
  Lines       21195    21246      +51     
  Branches     3456     3461       +5     
==========================================
+ Hits        13817    13929     +112     
+ Misses       5664     5597      -67     
- Partials     1714     1720       +6     

see 17 files with indirect coverage changes

@prabhask5
Copy link
Contributor Author

@peternied @scrawfor99 @cwperks Ready for review!

Signed-off-by: Prabhas Kurapati <[email protected]>
@prabhask5 prabhask5 requested a review from peternied January 18, 2024 19:30
@peternied peternied changed the title [BUG-1402] Return HTTP 409 on version confict when creating & updating tenants - added relevant unit test Validate 409s occur when multiple config updates happen simultaneously Jan 18, 2024
Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

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

LGTM!

@cwperks cwperks added the backport 2.x backport to 2.x branch label Jan 19, 2024
@cwperks cwperks merged commit 15f5b7b into opensearch-project:main Jan 19, 2024
83 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 19, 2024
#3909)

### Description
Added new TenantAsyncActionTest.java file to put api unit tests for the
/api/tenants api call- additionally wrote new unit test to test for
parallel PUT /tenant/{name} calls, that they successfully return a 409
call and retry the call.

* Category (Enhancement, New feature, Bug fix, Test fix, Refactoring,
Maintenance, Documentation)
Test fix

* Why these changes are required?
There was no test that checked for the behavior mentioned in the linked
ticket, so previously we didn't know if the issue still existed or not
(it apparently was fixed before), to make sure this doesn't happen again
for this particular case, I decided to write a concrete test for it.

* What is the old behavior before changes and new behavior after
changes?
Test was added, there's no behavior change?

### Issues Resolved
- #1402 - added unit test to cover bug in this issue

### Testing
Added new tenant action unit test to test parallel tenant api calls.

### Check List
- [x] New functionality includes testing
- [x] New functionality has been documented
- [x] 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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Prabhas Kurapati <[email protected]>
(cherry picked from commit 15f5b7b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
peternied pushed a commit that referenced this pull request Jan 19, 2024
…n simultaneously (#3962)

Backport 15f5b7b from #3909.

Signed-off-by: Prabhas Kurapati <[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>
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
opensearch-project#3909)

### Description
Added new TenantAsyncActionTest.java file to put api unit tests for the
/api/tenants api call- additionally wrote new unit test to test for
parallel PUT /tenant/{name} calls, that they successfully return a 409
call and retry the call.

* Category (Enhancement, New feature, Bug fix, Test fix, Refactoring,
Maintenance, Documentation)
Test fix

* Why these changes are required?
There was no test that checked for the behavior mentioned in the linked
ticket, so previously we didn't know if the issue still existed or not
(it apparently was fixed before), to make sure this doesn't happen again
for this particular case, I decided to write a concrete test for it.

* What is the old behavior before changes and new behavior after
changes?
Test was added, there's no behavior change?

### Issues Resolved
- opensearch-project#1402 - added unit test to cover bug in this issue

### Testing
Added new tenant action unit test to test parallel tenant api calls.

### Check List
- [x] New functionality includes testing
- [x] New functionality has been documented
- [x] 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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Prabhas Kurapati <[email protected]>
@prabhask5 prabhask5 deleted the pk-add-async-tenant-creation-test branch July 10, 2024 17:14
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants