Add containerName param to probe func#3006
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3006 +/- ##
==========================================
+ Coverage 60.71% 60.79% +0.07%
==========================================
Files 292 292
Lines 24708 24708
==========================================
+ Hits 15002 15021 +19
+ Misses 8058 8050 -8
+ Partials 1648 1637 -11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| func decideProbeResult(stderr string, probeNum int) PodConnectivityMark { | ||
| countConnected := probeNum - strings.Count(stderr, "\n") | ||
| countDropped := strings.Count(stderr, "TIMEOUT") | ||
| countRejected := strings.Count(stderr, "REFUSED") + strings.Count(stderr, "no route to host") | ||
|
|
||
| return curConnectivity | ||
| if countRejected == 0 && countConnected > 0 { | ||
| return Connected | ||
| } | ||
| if countConnected == 0 && countRejected > 0 { | ||
| return Rejected | ||
| } | ||
| if countDropped == probeNum { | ||
| return Dropped | ||
| } | ||
| return Error |
There was a problem hiding this comment.
wasn't this part of another PR aimed at fixing FQDN e2e test flakes?
There was a problem hiding this comment.
Yes, this is in that FQDN flake PR. Because this PR is also kind of involved in this decideProbeResult issue, I'm thinking if this could be merged by this PR?
63e92ca to
3395789
Compare
ac29963 to
a8e9bbb
Compare
21e7d4f to
71d2375
Compare
|
/test-e2e |
This PR has two changes:
1. Adds a parameter `containerName` to `probe` func.
Previously we use "c[port]" as containerName in `probe` to call
`runCommandFromPod`. But in this case, `probe` func couldn't work
with the client created by `createAgnhostPodOnNode` or functions that
create Pod with different container names. We hope `probe` func could
be more generic, so I add `containerName` parameter. Let the caller
to choose the containerName.
2. Changes the way that how we decides the connectivity.
Our framework will do probe 3 times to get the connectivity. Previous
logic is:
- If one of them connected, then it's connected.
- If no one connected and one of them is timeout, then it's
dropped.
- All other situation return rejected.
This could be a problem. For example: `testRejectServiceTraffic`
creates an agnhost Pod as client and use `probe` func to do the
probe. But agnhost Pod doesn't have "c[port]" container. So this
probe falls into the third case. It will always return rejected which
is also what we expected! Also, sometimes, due to the pressure on our
testbed or other test-side timing issues, it will return timeout. We
shouldn't take this as a `dropped`.
Now change the the logic to:
- If no one connected and at least one got rejected, then return
rejected.
- If no one rejected and at least one connected, then return
connected.
- If all probes timeout, then return dropped.
- All other sithation return error.
Signed-off-by: wgrayson <wgrayson@vmware.com>
Signed-off-by: wgrayson <wgrayson@vmware.com>
71d2375 to
b33ec6c
Compare
|
Test |
|
/test-e2e |
|
/skip-conformance |
This PR has two changes:
containerNametoprobefunc.Previously we use "c[port]" as containerName in
probeto callrunCommandFromPod. But in this case,probefunc couldn't workwith the client created by
createAgnhostPodOnNodeor functions thatcreate Pod with different container names. We hope
probefunc couldbe more generic, so I add
containerNameparameter. Let the callerto choose the containerName.
Our framework will do probe 3 times to get the connectivity. Previous
logic is:
dropped.
This could be a problem. For example:
testRejectServiceTrafficcreates an agnhost Pod as client and use
probefunc to do theprobe. But agnhost Pod doesn't have "c[port]" container. So this
probe falls into the third case. It will always return rejected which
is also what we expected! Also, sometimes, due to the pressure on our
testbed or other test-side timing issues, it will return timeout. We
shouldn't take this as a
dropped.Now change the the logic to:
rejected.
connected.
Signed-off-by: wgrayson wgrayson@vmware.com