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

x/review/git-codereview: tests fail with "Permission denied" on certain builders #32836

Closed
bcmills opened this issue Jun 28, 2019 · 11 comments
Closed
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Dragonfly OS-illumos Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Jun 28, 2019

It's not obvious to me whether this one is a builder misconfiguration or a missing check and Skip in the tests, but the golang.org/x/review/git-codereview tests consistently fail on the illumos-amd64-joyent builder.

https://build.golang.org/log/8e941dad2bba091bf6494b1702b1865b8723fbba:

--- FAIL: TestLoadAuth (0.35s)
    util_test.go:242: in git-client/, ran [git commit -m msg
        
        Change-Id: I123456789
        ] with git version 2.2.1
        :
        exit status 1
        fatal: cannot exec '.git/hooks/pre-commit': Permission denied

and many similar failures.

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 28, 2019
@gopherbot gopherbot added this to the Unreleased milestone Jun 28, 2019
@bcmills
Copy link
Contributor Author

bcmills commented Jun 28, 2019

Same failure mode on dragonfly-amd64.
https://build.golang.org/log/9a3d9b0108508ecf8d760fb3ff008cdbea2be4e6

@bcmills bcmills changed the title x/review/git-codereview: tests fail with "Permission denied" on illumos-amd64-joyent builder x/review/git-codereview: tests fail with "Permission denied" on certain builders Jun 28, 2019
@gopherbot
Copy link

Change https://golang.org/cl/192327 mentions this issue: dashboard: disable failing repos on misconfigured builders

@bcmills
Copy link
Contributor Author

bcmills commented Aug 29, 2019

CC @tdfbsd @toothrot @dmitshur

gopherbot pushed a commit to golang/build that referenced this issue Aug 29, 2019
Updates golang/go#32836
Updates golang/go#31567
Updates golang/go#11811

Change-Id: I5443b61cf7732abf906ce2e93eca5408579a55c8
Reviewed-on: https://go-review.googlesource.com/c/build/+/192327
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
@timdarbydotnet
Copy link

How do I force this particular test to run?

@gopherbot
Copy link

Change https://golang.org/cl/192557 mentions this issue: go.mod: add go version directive

@bcmills
Copy link
Contributor Author

bcmills commented Aug 30, 2019

@tdfbsd, if you just run go test golang.org/x/review/git-codereview/... that should do the trick.

gopherbot pushed a commit to golang/review that referenced this issue Aug 30, 2019
(I mostly just wanted to make a trivial change to this repo to clear
out the failure cells for misconfigured builders on the landing page
of https://build.golang.org.)

Updates golang/go#32836

Change-Id: Ibcea7e75912ca377fd78cef37d8beb29ab8b83d3
Reviewed-on: https://go-review.googlesource.com/c/review/+/192557
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@timdarbydotnet
Copy link

The builder is running as root and for some reason that's the problem. When I run it as a normal user, it works.

@timdarbydotnet
Copy link

I can't think of why running as root would cause this problem, but it's 100% reproducible.

@bcmills
Copy link
Contributor Author

bcmills commented Sep 3, 2019

Aha, I think it's a bug in the test here:
https://github.com/golang/review/blob/5934012ba8014dec70c822aae374611bca0d7107/git-codereview/util_test.go#L162-L173

Probably when running as root those hooks aren't created by any other means, so the test creates its own hooks — but the write helper-function sets permission 0666 instead of something more reasonable for an executable hook (say, 0755).

codebien pushed a commit to codebien/build that referenced this issue Nov 13, 2019
Updates golang/go#32836
Updates golang/go#31567
Updates golang/go#11811

Change-Id: I5443b61cf7732abf906ce2e93eca5408579a55c8
Reviewed-on: https://go-review.googlesource.com/c/build/+/192327
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/211477 mentions this issue: git-codereview: write hooks with execute permission in tests

@gopherbot
Copy link

Change https://golang.org/cl/211497 mentions this issue: dashboard: re-enable "review" repo on Dragonfly and AIX builders

gopherbot pushed a commit to golang/build that referenced this issue Dec 16, 2019
This partially reverts CL 192327.

Reason for revert: x/review failure turned out to be a bug in the test.

Updates golang/go#32836

Change-Id: I189ad4ebc1b48fbdbb64f3e42ab1459761ff0c8c
Reviewed-on: https://go-review.googlesource.com/c/build/+/211497
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
@golang golang locked and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Dragonfly OS-illumos Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants