-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/go/packages: TestJSON may be non-deterministic/flaky #27594
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
Comments
It happened again on https://build.golang.org/log/c5f6c6b6e6863169c92564c528adbb0cbc163b23 So it's not just FreeBSD that's affected. Just providing another data point on the issue. |
Another data point: I've run into this issue locally as well, Go 1.10.3 on Linux. I've only hit that bug once so far, after dozens of times of running the tests (as part of my normal work, not specifically testing for this issue) |
c and d are the roots, so this shows the roots of the graph are incorrectly ordered. The Visit function does guarantee a stable order when traversing the dependencies of the roots. |
Change https://golang.org/cl/143737 mentions this issue: |
This seems to be re-occurring but for Go 1.10 only, see #28609. |
I can't reproduce this locally on
darwin/amd64
, but I've seenTestJSON
fail many times with the same error message on various less common environments:For example, it failed just now on
freebsd-amd64-10_3
builder for Go 1.10. See https://build.golang.org/log/b5fd57cad07f4cb3e1e3c9e1654a21fc23d7c025.The diff in JSON is simply that the last two packages
c
andd
are swapped.Looking at the source code of
TestJSON
, packagesc
andd
both depend onb
only, so unlessgo/packages
API is meant to guarantee a stable package visiting order,d
being visited beforec
seems valid. Perhaps on those unusual environments, filesystem directory listing is not deterministic, causingd
sometimes to be visited beforec
./cc @ianthehat @matloob
The text was updated successfully, but these errors were encountered: