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

[Refactor] Improve asynchronous test cases format #3601

Merged
merged 6 commits into from
Oct 30, 2023

Conversation

peternied
Copy link
Member

Description

Improve asynchronous test cases format

  • Created AsyncActions to help generate and collect results
  • Use of CountDownLatch to trigger requests to run concurrently
  • Shrunk existing test cases by 2.7 times

Issues Resolved

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: Peter Nied <petern@amazon.com>
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Merging #3601 (5309a6e) into main (499db78) will increase coverage by 0.00%.
Report is 4 commits behind head on main.
The diff coverage is n/a.

❗ Current head 5309a6e differs from pull request most recent head 27969f5. Consider uploading reports for the commit 27969f5 to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #3601   +/-   ##
=========================================
  Coverage     64.90%   64.90%           
  Complexity     3638     3638           
=========================================
  Files           284      284           
  Lines         20616    20619    +3     
  Branches       3390     3391    +1     
=========================================
+ Hits          13381    13383    +2     
  Misses         5555     5555           
- Partials       1680     1681    +1     

see 3 files with indirect coverage changes

Signed-off-by: Peter Nied <petern@amazon.com>
…port output very much

Signed-off-by: Peter Nied <petern@amazon.com>
Signed-off-by: Peter Nied <petern@amazon.com>
Signed-off-by: Peter Nied <petern@amazon.com>
@peternied
Copy link
Member Author

@cwperks here are those improvements from the first PR, let me know what you think

cwperks
cwperks previously approved these changes Oct 27, 2023
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.

@peternied Looks good to me. I left a couple of questions to make sure I understand how the AsyncActions works and the new test log4j property.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

looks good to me @peternied . Just some nits and question to understand the update to log4j properties

Signed-off-by: Peter Nied <petern@amazon.com>
@peternied
Copy link
Member Author

@cwperks Could you take another look at this change?

@peternied peternied merged commit 1ad8cf4 into opensearch-project:main Oct 30, 2023
@peternied peternied added the backport 2.x backport to 2.x branch label Oct 30, 2023
@peternied peternied deleted the better-async-tests branch October 30, 2023 19:04
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-3601-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1ad8cf480cd31d2fd10fdb16e974816cb64fe0a8
# Push it to GitHub
git push --set-upstream origin backport/backport-3601-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-3601-to-2.x.

peternied added a commit to peternied/security that referenced this pull request Oct 30, 2023
…search-project#3601)

Signed-off-by: Peter Nied <petern@amazon.com>
(cherry picked from commit 1ad8cf4)
@peternied
Copy link
Member Author

Manually backported to 2.x because of the apache imports that were using v5

cwperks pushed a commit that referenced this pull request Oct 31, 2023
… (#3630)

### Description
Signed-off-by: Peter Nied <petern@amazon.com>
(cherry picked from commit 1ad8cf4)
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.

4 participants