Skip to content

Fix TestPodSidecarLabelChangeTriggersAddIptablesAction flake#636

Merged
kmesh-bot merged 2 commits intokmesh-net:mainfrom
hzxuzhonghu:fix-test-flake
Jul 31, 2024
Merged

Fix TestPodSidecarLabelChangeTriggersAddIptablesAction flake#636
kmesh-bot merged 2 commits intokmesh-net:mainfrom
hzxuzhonghu:fix-test-flake

Conversation

@hzxuzhonghu
Copy link
Copy Markdown
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Jul 25, 2024
@kmesh-bot kmesh-bot requested review from YaoZengzeng and kwb0523 July 25, 2024 09:44
@hzxuzhonghu hzxuzhonghu requested review from Okabe-Rintarou-0 and removed request for YaoZengzeng and kwb0523 July 25, 2024 09:44
client := fake.NewSimpleClientset(namespace)
c := NewByPassController(client)
go c.Run(stopCh)
cache.WaitForCacheSync(stopCh, c.pod.HasSynced)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the root cause

Copy link
Copy Markdown
Member

@Okabe-Rintarou-0 Okabe-Rintarou-0 Jul 25, 2024

Choose a reason for hiding this comment

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

i am also fixing it. you can directly call c.Run(stopCh), just remove go.
There is already cache.WaitForCacheSync(stopCh, c.pod.HasSynced) in c.Run

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, here we can

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.37%. Comparing base (f5f92ac) to head (7fc23fb).
Report is 57 commits behind head on main.

Files Coverage Δ
pkg/controller/bypass/bypass_controller.go 39.08% <100.00%> (-2.68%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06c2e03...7fc23fb. Read the comment docs.

@Okabe-Rintarou-0
Copy link
Copy Markdown
Member

i also found that the NODE_NAME env is not aligned with the one in the test pod's spec.nodeName.
One is test_node, another is test-node, will it cause some problem?

@hzxuzhonghu
Copy link
Copy Markdown
Member Author

They should match. Weired, why the test passed

@hzxuzhonghu
Copy link
Copy Markdown
Member Author

Oh, it is because fake client does not support field selector, which actually works in kube-apiserver

Signed-off-by: Zhonghu Xu <xuzhonghu@huawei.com>
@hzxuzhonghu
Copy link
Copy Markdown
Member Author

ping @supercharge-xsy

Copy link
Copy Markdown
Member

@Okabe-Rintarou-0 Okabe-Rintarou-0 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

@YaoZengzeng
Copy link
Copy Markdown
Member

@hzxuzhonghu maybe this PR could be merged?

@hzxuzhonghu
Copy link
Copy Markdown
Member Author

@nlgwcy I thought it was merged

@supercharge-xsy
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@kmesh-bot
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Okabe-Rintarou-0, supercharge-xsy

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

The pull request process is described here

Details 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

@kmesh-bot kmesh-bot merged commit 75a7312 into kmesh-net:main Jul 31, 2024
@hzxuzhonghu hzxuzhonghu deleted the fix-test-flake branch July 31, 2024 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants