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

repair the cluster_status_controller_test #3948

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

zishen
Copy link
Member

@zishen zishen commented Aug 16, 2023

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
After the controller runtime update here, test case need to be adapted.

Which issue(s) this PR fixes:
Fixes #3730

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

@RainbowMango @XiShanYongYe-Chang

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 16, 2023
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 16, 2023
@RainbowMango
Copy link
Member

Just reminder, the test is failing:

=== RUN   TestWorkStatusController_registerInformersAndStart/failed_to_getSingleClusterManager
E0816 11:51:42.935972   17789 work_status_controller.go:470] Failed to build dynamic cluster client for cluster cluster.
=== RUN   TestWorkStatusController_registerInformersAndStart/failed_to_getGVRsFromWork
E0816 11:51:43.036795   17789 work_status_controller.go:448] Failed to unmarshal workload. Error: invalid character ',' after top-level value.
--- PASS: TestWorkStatusController_registerInformersAndStart (0.13s)
    --- PASS: TestWorkStatusController_registerInformersAndStart/normal_case (0.00s)
    --- PASS: TestWorkStatusController_registerInformersAndStart/failed_to_getSingleClusterManager (0.00s)
    --- PASS: TestWorkStatusController_registerInformersAndStart/failed_to_getGVRsFromWork (0.10s)
=== NAME  
    testing.go:1446: race detected during execution of test
FAIL
	github.com/karmada-io/karmada/pkg/controllers/status	coverage: 66.2% of statements
FAIL	github.com/karmada-io/karmada/pkg/controllers/status	2.273s

@zishen
Copy link
Member Author

zishen commented Aug 17, 2023

Just reminder, the test is failing:

=== RUN   TestWorkStatusController_registerInformersAndStart/failed_to_getSingleClusterManager
E0816 11:51:42.935972   17789 work_status_controller.go:470] Failed to build dynamic cluster client for cluster cluster.
=== RUN   TestWorkStatusController_registerInformersAndStart/failed_to_getGVRsFromWork
E0816 11:51:43.036795   17789 work_status_controller.go:448] Failed to unmarshal workload. Error: invalid character ',' after top-level value.
--- PASS: TestWorkStatusController_registerInformersAndStart (0.13s)
    --- PASS: TestWorkStatusController_registerInformersAndStart/normal_case (0.00s)
    --- PASS: TestWorkStatusController_registerInformersAndStart/failed_to_getSingleClusterManager (0.00s)
    --- PASS: TestWorkStatusController_registerInformersAndStart/failed_to_getGVRsFromWork (0.10s)
=== NAME  
    testing.go:1446: race detected during execution of test
FAIL
	github.com/karmada-io/karmada/pkg/controllers/status	coverage: 66.2% of statements
FAIL	github.com/karmada-io/karmada/pkg/controllers/status	2.273s

yea, It is course by "race detected during execution of test", I need to make a analysis.

@zishen zishen force-pushed the repair_ut branch 2 times, most recently from c74a98e to 2a8fb8e Compare August 17, 2023 13:00
}()
wg.Wait()
Copy link
Member

Choose a reason for hiding this comment

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

The lease controller will keep running and never stop in normal cases. Seems we don't need to wait for it to complete.

@karmada-bot karmada-bot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Aug 19, 2023
@karmada-bot karmada-bot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Aug 19, 2023
Signed-off-by: Tanggui Bian <softwarebtg@163.com>
@codecov-commenter
Copy link

Codecov Report

Merging #3948 (bc689e9) into master (24bb582) will increase coverage by 0.13%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #3948      +/-   ##
==========================================
+ Coverage   54.69%   54.83%   +0.13%     
==========================================
  Files         229      229              
  Lines       22086    22086              
==========================================
+ Hits        12080    12110      +30     
+ Misses       9358     9324      -34     
- Partials      648      652       +4     
Flag Coverage Δ
unittests 54.83% <ø> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2023
@karmada-bot karmada-bot merged commit 3710dc4 into karmada-io:master Aug 21, 2023
12 checks passed
@zishen zishen deleted the repair_ut branch August 22, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants