-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Conversation
@@ -25,42 +24,6 @@ import ( | |||
"testing" | |||
) | |||
|
|||
func TestSplitYAMLDocument(t *testing.T) { |
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 expect this test case to be preserved and still pass.
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.
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.
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.
@smarterclayton ok will add this back.
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 | ||
|
||
--- |
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.
Add new test case with lines > 64kb
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.
Maybe https://golang.org/pkg/bytes/#Repeat can help
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) |
What's the status here? Just ran into this problem myself. |
@SleepyBrett generally it should be ok, tests are needed. |
@smarterclayton I just update this, ptal. |
GCE e2e build/test passed for commit 2d06408. |
|
||
// Read returns a full YAML document. | ||
func (r *YAMLReader) Read() ([]byte, error) { | ||
var buffer bytes.Buffer |
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.
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.
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.
@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.
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.
That's right, because we don't have a scanning parser. Ok, withdrawn.
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 2d06408. |
Automatic merge from submit-queue |
This most likely broke kubernetes-test-go. Reverting. |
I have a fix |
The fix is #30772 |
@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. |
cc @fejta |
@ncdc thanks for help fix this, the jenkins unit/int job behavior is a little bit strange. |
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. |
Seems like PR Jenkins should fail on any junit failures. On Thu, Aug 18, 2016 at 6:43 PM, Jeff Grafton notifications@github.com
|
@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. |
Post-submit tests detect flakes in a more reliable way so they behave differently. |
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.) |
I dunno. I think this is WAI and issues like this should be rare. |
Wouldn't you want to avoid a PR merging that immediately turns On Thursday, August 18, 2016, Daniel Smith notifications@github.com wrote:
|
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) |
@smarterclayton ptal. Also refer #19603 #23125 for more details.
This change is