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

[Improvement][UT] Improve Worker registry coverage #15380

Merged
merged 13 commits into from
Feb 6, 2024

Conversation

pegasas
Copy link
Contributor

@pegasas pegasas commented Dec 29, 2023

Purpose of the pull request

part of #10573
try to resolve #15396
Improve worker registry coverage above 85%

Brief change log

Improve worker registry coverage above 85%

Verify this pull request

image

@pegasas pegasas force-pushed the worker-registry-ut branch 2 times, most recently from 2f1ae90 to 0ed1e8a Compare December 29, 2023 03:19
@EricGao888 EricGao888 added the improvement make more easy to user or prompt friendly label Dec 29, 2023
@EricGao888 EricGao888 modified the milestones: 3.2.1, 4.0.0-alpha Dec 29, 2023
Copy link
Member

@EricGao888 EricGao888 left a comment

Choose a reason for hiding this comment

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

Basically LGTM

EricGao888
EricGao888 previously approved these changes Dec 29, 2023
EricGao888
EricGao888 previously approved these changes Dec 29, 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.

Good job, wait fix the spotless.


import org.junit.jupiter.api.Assertions;
import org.junit.Assert;
Copy link
Member

Choose a reason for hiding this comment

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

Please use Assertions.

@fuchanghai
Copy link
Member

fuchanghai commented Jan 3, 2024

hi @pegasas should we create a new issue associated with this PR @EricGao888 and add this issue to #10573?

@pegasas
Copy link
Contributor Author

pegasas commented Jan 3, 2024

hi @pegasas should we create a new issue associated with this PR @EricGao888 and add this issue to #10573?

This may be more reliable.
I've create an issue and attach it into these threads.

@EricGao888
Copy link
Member

As CI output said, you could run 'mvn spotless:apply' to fix these style violations.

@pegasas
Copy link
Contributor Author

pegasas commented Jan 11, 2024

As CI output said, you could run 'mvn spotless:apply' to fix these style violations.

Thanks @EricGao888!
I've correct the style violation.

EricGao888
EricGao888 previously approved these changes Jan 11, 2024
Copy link
Member

@EricGao888 EricGao888 left a comment

Choose a reason for hiding this comment

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

LGTM if CI passes

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (43a0652) 38.36% compared to head (780951c) 38.53%.

❗ Current head 780951c differs from pull request most recent head 8ad497c. Consider uploading reports for the commit 8ad497c to get more accurate results

Files Patch % Lines
.../server/worker/registry/WorkerWaitingStrategy.java 55.55% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev   #15380      +/-   ##
============================================
+ Coverage     38.36%   38.53%   +0.16%     
- Complexity     4744     4770      +26     
============================================
  Files          1305     1305              
  Lines         44830    44838       +8     
  Branches       4803     4805       +2     
============================================
+ Hits          17200    17278      +78     
+ Misses        25759    25684      -75     
- Partials       1871     1876       +5     

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

@pegasas
Copy link
Contributor Author

pegasas commented Jan 11, 2024

Hi, @ruanwenjun , @SbloodyS , It seems other gated passed, would you like to take a look when anytime available?

@@ -52,6 +53,16 @@ public class WorkerWaitingStrategy implements WorkerConnectStrategy {
@Autowired
private WorkerTaskExecutorThreadPool workerManagerThread;

public WorkerWaitingStrategy(@NonNull WorkerConfig workerConfig,
Copy link
Member

Choose a reason for hiding this comment

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

hi @pegasas Through the @service annotation, I judge that this class is a singleton and injected into the spring container, so is this constructor necessary? Where is it used? Is there anything I haven't noticed?

@rickchengx
Copy link
Contributor

Hi, @pegasas please resolve the conflicts

@pegasas
Copy link
Contributor Author

pegasas commented Jan 23, 2024

Hi, @pegasas please resolve the conflicts

Thanks @rickchengx , I've update my PR with merging conflicts.
image
passing in my local environment.

@rickchengx
Copy link
Contributor

Hi, @pegasas there is still an unresolved comment from @fuchanghai, please check

@pegasas
Copy link
Contributor Author

pegasas commented Jan 29, 2024

Hi, @pegasas there is still an unresolved comment from @fuchanghai, please check

thanks @rickchengx
Hi, @fuchanghai, do we have any other solutions for the questions?
Shall we keep it that way?

Copy link
Contributor

@rickchengx rickchengx left a comment

Choose a reason for hiding this comment

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

LGTM

@rickchengx
Copy link
Contributor

will merge tomorrow if no more comments

@EricGao888
Copy link
Member

CI failures seem not related to the changes. I've restarted it and let's see whether it could pass this time.

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.

LGTM

Copy link

sonarcloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

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

10 New issues
0 Security Hotspots
76.5% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@rickchengx rickchengx merged commit 69676b4 into apache:dev Feb 6, 2024
56 checks passed
@pegasas pegasas deleted the worker-registry-ut branch February 6, 2024 02:47
zhongjiajie pushed a commit that referenced this pull request Feb 6, 2024
Co-authored-by: fuchanghai <changhaifu@apache.org>
Co-authored-by: Eric Gao <ericgao.apache@gmail.com>
Co-authored-by: Rick Cheng <rickchengx@gmail.com>
(cherry picked from commit 69676b4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend improvement make more easy to user or prompt friendly ready-to-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement][Unit Tests] Improve DolphinScheduler Worker unit tests
6 participants