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

TestRawInput() failed frequently. #136

Open
alanjds opened this issue Aug 18, 2018 · 2 comments
Open

TestRawInput() failed frequently. #136

alanjds opened this issue Aug 18, 2018 · 2 comments

Comments

@alanjds
Copy link
Owner

alanjds commented Aug 18, 2018

TestRawInput looks like have a significant issue.
Sometimes I can reproduce on my local environment.

--- FAIL: TestRawInput (0.00s)
	builtin_types_test.go:522: func1('HelloGrumpy\n', '') raised EOFError('EOF when reading a line',), want <nil>
Exception: foo
@alanjds
Copy link
Owner Author

alanjds commented Aug 18, 2018

Comment by trotterdylan
Thursday Apr 06, 2017 at 14:40 GMT


I worked on this for a little while but haven't yet figured out the problem. I was able to reproduce it more reliably if my machine was under load, e.g. by running tests in parallel.

There's two issues. The first is that these lines need to handle EOF explicitly:

	line, err := Stdin.reader.ReadString('\n')
	if err != nil {
		return nil, f.RaiseType(EOFErrorType, "EOF when reading a line")
	}

Should be something like:

	line, err := Stdin.reader.ReadString('\n')
	if err != nil && err != io.EOF {
		return nil, f.RaiseType(IOErrorType, err.Error())
	}
        if line == "" {
                return nil, f.RaiseType(EOFErrorType, "EOF when reading a line")
        }

When you do this you find that the error is actually "bad file". So Stdin is getting closed or something in the mean time. But I couldn't figure out why.

@alanjds
Copy link
Owner Author

alanjds commented Aug 18, 2018

Comment by trotterdylan
Friday Apr 07, 2017 at 14:15 GMT


The test seems to be failing a lot more frequently on Travis lately, so I commented out the test in google@a76caef until it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant