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

doc/progs: flaky on OpenBSD #10497

Closed
mdempsky opened this issue Apr 18, 2015 · 4 comments
Closed

doc/progs: flaky on OpenBSD #10497

mdempsky opened this issue Apr 18, 2015 · 4 comments
Milestone

Comments

@mdempsky
Copy link
Contributor

These tests are flaking on OpenBSD (both 386 and amd64) a lot:

https://storage.googleapis.com/go-build-log/8c918ef1/openbsd-amd64-gce56_503d834e.log

@mdempsky mdempsky self-assigned this Apr 18, 2015
@mdempsky
Copy link
Contributor Author

It looks like 5451fff introduced a race condition (@josharian @bradfitz), but I'm not sure why it's only flaking on OpenBSD.

The problem is we're (simplified) concurrently running "go build go1.go; ./go1; rm go1" and "go build slices.go; ./slices; rm slices".

Within go1, there's a call to filepath.Walk(".", walkFn). filepath.Walk reads the list of files in the directory, then proceeds to lstat each of them, and call walkFn. What's happening is "slices" exists when go1 is reading the list of files in the directory, but the other test has removed it before go1 gets around to lstat'ing it. Then walkFn fails, which causes go1 to call log.Fatal, which causes doc/progs/run.go to fail.

Previously this was not a problem because:

  1. The tests were synchronous.
  2. All of the test programs were built first, then some of them were run, then they were all deleted.

Two options I see:

  1. Build the test programs in a separate temporary directory and run them from there, like how "go run" works.
  2. Build the programs in parallel, then test them in parallel, then delete them all.

@josharian
Copy link
Contributor

Blech. Thanks for tracking that down. It seems like option 1 would more closely maintain the prior behavior.

@mdempsky
Copy link
Contributor Author

Do you mean option 2 would be closer to maintain the prior behavior? doc/progs/run used to be roughly:

for i in $all; do
  go build $i.go
done

testit blah1...
testit blah2...

rm -f $all

Either way, I'll look into a fix later, but feel free to steal the issue if you want.

@josharian josharian added this to the Go1.5 milestone Apr 18, 2015
@josharian
Copy link
Contributor

If you're willing to take it, it's all yours.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants