-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
fix newline in raw string in e2e net perf case #46581
Conversation
Hi @m1093782566. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
That's this PR! |
@spxtr updated. |
/unassign |
@k8s-bot ok to test |
@cblecker test flakes? |
@k8s-bot pull-kubernetes-e2e-kops-aws test this |
ha ha. It seems that k8s-bot does not response to me. THANKS, @gyliu513 |
Yes, for now only Member can run |
@m1093782566 The federation test is flaky atm, but also non-blocking. We can leave that failed -- it won't block your PR from merging. Next step is waiting for one of the reviewers to look over your change. |
@cblecker Thanks for reminding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this actually would not still generate an error.
I tried an example in the Go playground here
Please check https://play.golang.org/p/XuelZdR6a9 |
Yep that example works since you convert prior to parsing. I should also ask what platform you are running these tests on and can you provide a test run that fails. |
@cmluciano My environment is centos 7.2 kubeadm cluster. It's a bit difficult to create a failure case in CI environment which I think it's a debain OS. However, I guess trim newline in a string does no harm? |
The tests use a specific library that makes this a little easier. I think just a unit test as you mentioned should suffice. |
@cmluciano Do you mean I should unit test I just don't know how to write unit test cases in e2e framework and how to make e2e run unit test cases. Could you please give me some hints? Thanks very much. |
Sorry, I just realized that this actually WAS the e2e. We could try to stub that int in another case, but it probably is not worthwhile. Let's just re-arrange the PR to strip the newline prior to parsing for now and then see what the reviewers think of another test case. |
/retest |
98c450b
to
117260f
Compare
@sstarcher Please look at here. Did you meet the same issue in AWS/CoreOS setup? |
Sorry, but to be honest, I don't very understand your expectation - I can reproduce this issue in my local centos setup, and @sstarcher saw this issue in his AWS/CoreOS setup. I just don't know much about why it does not occur in k8s CI environment. Should we keep this PR open? Would much appreciate if you can give any idea. Thanks! |
117260f
to
701744d
Compare
Would appreciate if you can give your opinions. Thanks a lot :) |
I was using the https://github.com/coreos/tectonic-installer at the time when I reported I saw that issue running the conformance tests. It was installed in AWS using coreos. |
701744d
to
f0a39fb
Compare
/retest |
test/e2e/network/util_iperf.go
Outdated
@@ -97,6 +97,8 @@ func (s StrSlice) get(i int) string { | |||
|
|||
// intOrFail is a convenience function for parsing integers. | |||
func intOrFail(debugName string, rawValue string) int64 { | |||
// Trim newline in raw string before parsing it | |||
rawValue = strings.Replace(rawValue, "\n", "", -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem great to me. We should be Trim()ing the string before handing to this function. Also, this function makes
"1\n2\n3\n5" become a valid integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. PTAL. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would fix the calling places where the newline is being introduced.
f0a39fb
to
66fee82
Compare
Glad to receive your feedback, @bowei I fixed the newline in the beginning of |
test/e2e/network/util_iperf.go
Outdated
@@ -69,6 +69,8 @@ func (i *IPerfResults) ToTSV() string { | |||
|
|||
// NewIPerf parses an IPerf CSV output line into an IPerfResult. | |||
func NewIPerf(csvLine string) *IPerfResult { | |||
// Trim newline in csv string line before parsing it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, removed this comment.
66fee82
to
7ffd5b2
Compare
All comments are fixed now and this PR has been pending for a while... |
/lgtm |
/approve no-issue |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, m1093782566 Associated issue: 46083 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 46581, 55426, 54849). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Which issue this PR fixes
fixes #46083