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

Reduce test running time #965

Merged

Conversation

bowenlan-amzn
Copy link
Member

@bowenlan-amzn bowenlan-amzn commented Oct 1, 2023

Issue #, if available:

Description of changes:

Our long integration test time has always been a pain point. This PR tackles down several long running tests and improve the test time a lot.
RollupActionIT 6m -> 1m
SMRunnnerIT 1m -> 10s
...
All the ValidateIT are removed since those are kind of duplicate to ActionIT, UT is better to substitute those.
Total time 35-40m -> ~26m

CheckList:

  • 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: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
@codecov
Copy link

codecov bot commented Oct 1, 2023

Codecov Report

Merging #965 (60d4bb0) into main (12ab12f) will decrease coverage by 1.04%.
The diff coverage is 100.00%.

❗ Current head 60d4bb0 differs from pull request most recent head ee2b2b6. Consider uploading reports for the commit ee2b2b6 to get more accurate results

@@             Coverage Diff              @@
##               main     #965      +/-   ##
============================================
- Coverage     75.72%   74.69%   -1.04%     
+ Complexity     2845     2779      -66     
============================================
  Files           364      364              
  Lines         16266    16263       -3     
  Branches       2343     2343              
============================================
- Hits          12317    12147     -170     
- Misses         2607     2817     +210     
+ Partials       1342     1299      -43     
Files Coverage Δ
...rch/indexmanagement/snapshotmanagement/SMRunner.kt 65.21% <100.00%> (ø)
...gement/snapshotmanagement/engine/SMStateMachine.kt 75.00% <100.00%> (ø)

... and 28 files with indirect coverage changes

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
assertEquals(expectedHistory, actualHistory)

waitFor { assertEquals("true", getIndexBlocksWriteSetting(indexName)) }
}

fun `test short retention period and history enabled`() {
fun `test history write index cannot be deleted if enabled, can be deleted if disabled`() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This IT covers history index rollover, retention(delete old history index that exceeds retention time which is not write index)
And disable history index will delete all history indexes

lezzago
lezzago previously approved these changes Oct 2, 2023
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
@bowenlan-amzn bowenlan-amzn merged commit dd50b3e into opensearch-project:main Oct 3, 2023
13 checks passed
@bowenlan-amzn bowenlan-amzn deleted the reduce-test-running-time branch October 3, 2023 17: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/index-management/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/index-management/backport-2.x
# Create a new branch
git switch --create backport/backport-965-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dd50b3eb6d9869f9b4c1d286e8ab9c298dcb73f1
# Push it to GitHub
git push --set-upstream origin backport/backport-965-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/index-management/backport-2.x

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

bowenlan-amzn added a commit to bowenlan-amzn/index-management that referenced this pull request Oct 3, 2023
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
@bowenlan-amzn bowenlan-amzn mentioned this pull request Oct 3, 2023
1 task
bowenlan-amzn added a commit to bowenlan-amzn/index-management that referenced this pull request Oct 3, 2023
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
bowenlan-amzn added a commit that referenced this pull request Oct 3, 2023
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Joshua152 pushed a commit to Joshua152/index-management that referenced this pull request Oct 10, 2023
* Reduce test running time

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

* Dig into several long running test

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

* cleanup

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

* debug bwc

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

* debug bwc

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

* ktlint

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>

---------

Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants