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

use Reader.ReadLine instead of bufio.Scanner to support bigger yaml #23265

Merged
merged 1 commit into from
Aug 17, 2016

Conversation

adohe-zz
Copy link

@adohe-zz adohe-zz commented Mar 21, 2016

@smarterclayton ptal. Also refer #19603 #23125 for more details.


This change is Reviewable

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 21, 2016
@@ -25,42 +24,6 @@ import (
"testing"
)

func TestSplitYAMLDocument(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect this test case to be preserved and still pass.

Copy link
Contributor

Choose a reason for hiding this comment

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

If you need to move the test cases or reduce their complexity that's fine, but we should be testing all of these edge cases still.

Copy link
Author

Choose a reason for hiding this comment

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

@smarterclayton ok will add this back.

@k8s-github-robot
Copy link

The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label?

func TestDecodeYAML(t *testing.T) {
s := NewYAMLToJSONDecoder(bytes.NewReader([]byte(`---
stuff: 1

---
Copy link
Contributor

Choose a reason for hiding this comment

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

Add new test case with lines > 64kb

Copy link
Contributor

Choose a reason for hiding this comment

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

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 25, 2016
@smarterclayton
Copy link
Contributor

If you can add this test we can probably get it into 1.3 (since it blocks users with long fields like secrets and config maps)

@SleepyBrett
Copy link

What's the status here? Just ran into this problem myself.

@adohe-zz
Copy link
Author

@SleepyBrett generally it should be ok, tests are needed.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 15, 2016
@adohe-zz
Copy link
Author

@smarterclayton I just update this, ptal.

@k8s-bot
Copy link

k8s-bot commented Aug 15, 2016

GCE e2e build/test passed for commit 2d06408.


// Read returns a full YAML document.
func (r *YAMLReader) Read() ([]byte, error) {
var buffer bytes.Buffer
Copy link
Contributor

Choose a reason for hiding this comment

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

Hrm - this implementation requires us to load the whole object into memory, rather than being line driven as before. I'd prefer if we didn't require that - we could have very large config objects on disk that this would then cause issues on.

Copy link
Author

Choose a reason for hiding this comment

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

@smarterclayton I am sorry I don't get the point. I think in the old scanner based approach, we still need to read a full yaml document into buffer before we decode it.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's right, because we don't have a scanning parser. Ok, withdrawn.

@smarterclayton smarterclayton added lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Aug 16, 2016
@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Aug 17, 2016

GCE e2e build/test passed for commit 2d06408.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 7b49d0c into kubernetes:master Aug 17, 2016
@adohe-zz adohe-zz deleted the big_yaml branch August 17, 2016 10:36
@gmarek
Copy link
Contributor

gmarek commented Aug 17, 2016

This most likely broke kubernetes-test-go. Reverting.

@ncdc
Copy link
Member

ncdc commented Aug 17, 2016

I have a fix

@ncdc
Copy link
Member

ncdc commented Aug 17, 2016

The fix is #30772

@ncdc
Copy link
Member

ncdc commented Aug 17, 2016

@pwittrock @ixdy @lavalamp the "Jenkins unit/integration" job for this PR reported SUCCESS but it in fact had a test "failure" (see https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/pr-logs/pull/23265/kubernetes-pull-test-unit-integration/39955/). This same "failure" was detected by the subsequent kubernetes-test-go job that ran after this PR was merged to master. The reason I put failure in quotes is because the test actually passed, but due to a missing newline in some test output, the junit processor thought the test had actually failed.

Do you all know why the unit/int job reported success here? We need to fix that.

@gmarek
Copy link
Contributor

gmarek commented Aug 17, 2016

cc @fejta

@adohe-zz
Copy link
Author

@ncdc thanks for help fix this, the jenkins unit/int job behavior is a little bit strange.

@ixdy
Copy link
Member

ixdy commented Aug 18, 2016

Yeah, the unit test passed, but go-junit-report parses the verbose test output, and since the newline was missing, it didn't think the test case passed.

We explicitly made PR Jenkins not fail on any junit failures in kubernetes/test-infra#246. I don't remember why now (though it links to #27898). CI Jenkins still fails on junit failures.

cc @lavalamp to see if he remembers.

@ncdc
Copy link
Member

ncdc commented Aug 18, 2016

Seems like PR Jenkins should fail on any junit failures.

On Thu, Aug 18, 2016 at 6:43 PM, Jeff Grafton notifications@github.com
wrote:

Yeah, the unit test passed, but go-junit-report
https://github.com/jstemmer/go-junit-report parses the verbose test
output, and since the newline was missing, it didn't think the test case
passed.

We explicitly made PR Jenkins not fail on any junit failures in
kubernetes/test-infra#246
kubernetes/test-infra#246. I don't remember why
now (though it links to #27898
#27898). CI Jenkins still
fails on junit failures.

cc @lavalamp https://github.com/lavalamp to see if he remembers.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#23265 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAABYlvHU-NbWIA4LVhREhKGEmAQv0Jvks5qhN_3gaJpZM4H03KM
.

@lavalamp
Copy link
Member

@ixdy you're saying the junit file incorrectly records a failure, when the test actually passed?

We rely on the test job to report success/failure, and not on the junit. This lets us, in ginkgo, report success but still record a failure (due to a flake) in the junit.

@lavalamp
Copy link
Member

Post-submit tests detect flakes in a more reliable way so they behave differently.

@ixdy
Copy link
Member

ixdy commented Aug 18, 2016

I think the complaint here is that PR and CI Jenkins handle junit differently. Should we make CI Jenkins ignore junit? (I'm guessing the answer here is yes.)

@lavalamp
Copy link
Member

I dunno. I think this is WAI and issues like this should be rare.

@ncdc
Copy link
Member

ncdc commented Aug 18, 2016

Wouldn't you want to avoid a PR merging that immediately turns
kubernetes-test-go red and blocks the submit queue? That's what happened
here. And it took several hours to resolve.

On Thursday, August 18, 2016, Daniel Smith notifications@github.com wrote:

I dunno. I think this is WAI and issues like this should be rare.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#23265 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAABYvdPpPhfL5SecU284iTn1TuLO_kEks5qhOONgaJpZM4H03KM
.

@lavalamp
Copy link
Member

Well, when you put it like that...

Yes, I'm in favor of them being the same, as long as you leave the flake finding optimization in place. (that is, if the test section says failures="0" then it's not a suite failure even if an individual test failure is present)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. 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.