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

[BUG] #15013 Fix retryInterval in RetryPolicy will never be used in RetryUtils #15014

Merged
merged 6 commits into from
Jan 25, 2024

Conversation

zhihuasu1
Copy link
Contributor

@zhihuasu1 zhihuasu1 commented Oct 11, 2023

fix #15013
close #14928

@zhihuasu1 zhihuasu1 changed the title retryInterval correct assignment [BUG] #15013 retryInterval correct assignment Oct 11, 2023
@ruanwenjun ruanwenjun changed the title [BUG] #15013 retryInterval correct assignment [BUG] #15013 Fix retryInterval in RetryPolicy will never be used in RetryUtils Oct 12, 2023
@ruanwenjun ruanwenjun added the bug Something isn't working label Oct 12, 2023
ruanwenjun
ruanwenjun previously approved these changes Oct 12, 2023
Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

LGTM, could you please add UT for this.
You can use Assertions.assertTimeout to assert this, or assert the end time - start time > interval * retry times

long startTime = System.currentTimeMillis();
Assertions.assertThrows(RuntimeException.class, () -> RetryUtils.retryFunction((Supplier<Boolean>) () -> {
    throw new RuntimeException("Test failed function");
}, new RetryUtils.RetryPolicy(3, 1000L)));
long endTime = System.currentTimeMillis();
Assertions.assertTrue(endTime - startTime >= 3000L && endTime - startTime < 4000L);

@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (95ae003) 38.02% compared to head (620fa8d) 38.02%.
Report is 1 commits behind head on dev.

❗ Current head 620fa8d differs from pull request most recent head d524fac. Consider uploading reports for the commit d524fac to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##                dev   #15014   +/-   ##
=========================================
  Coverage     38.02%   38.02%           
  Complexity     4693     4693           
=========================================
  Files          1304     1304           
  Lines         44812    44812           
  Branches       4804     4804           
=========================================
  Hits          17040    17040           
  Misses        25921    25921           
  Partials       1851     1851           

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

@SbloodyS SbloodyS added first time contributor First-time contributor 3.2.1 labels Oct 12, 2023
@SbloodyS SbloodyS added this to the 3.2.1 milestone Oct 12, 2023
fuchanghai
fuchanghai previously approved these changes Oct 12, 2023
Copy link
Member

@fuchanghai fuchanghai left a comment

Choose a reason for hiding this comment

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

+1

Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

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

Please run mvn spotless:apply to fix CI. @zhihuasu1

Copy link

sonarcloud bot commented Nov 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link

sonarcloud bot commented Jan 25, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@rickchengx rickchengx merged commit d80a29c into apache:dev Jan 25, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.1 backend bug Something isn't working first time contributor First-time contributor ready-to-merge
Projects
None yet
6 participants