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/build: we should run at least one windows builder as Administrator #23294

Open
alexbrainman opened this Issue Jan 1, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@alexbrainman
Member

alexbrainman commented Jan 1, 2018

Some tests do not run unless they are run by Administrator.

Compare normal user runs:

c:\>go test -v -short os | grep -i skip
--- SKIP: TestStatError (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestReaddirNValues (0.00s)
        os_test.go:515: test.short; skipping
--- SKIP: TestReaddirStatFailures (0.00s)
        os_test.go:601: skipping test on windows
--- SKIP: TestSymlink (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestLongSymlink (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestLargeWriteToConsole (0.00s)
        os_test.go:1817: skipping console-flooding test; enable with -large_write
--- SKIP: TestStatRelativeSymlink (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestSleep (0.00s)
        os_test.go:2072: Skipping in short mode
--- SKIP: TestRemoveAllRace (0.00s)
        os_test.go:2182: skipping on windows
--- SKIP: TestPipeThreads (0.00s)
        os_test.go:2217: skipping on Windows; issue 19098
--- SKIP: TestDirectorySymbolicLink (0.03s)
        os_windows_test.go:397: skipping some tests, could not enable "SeCreateSymbolicLinkPrivilege": Not all privileges or groups referenced are assigned to the caller.
--- SKIP: TestNetworkSymbolicLink (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestShareNotExistError (0.00s)
        os_windows_test.go:547: slow test that uses network; skipping
--- SKIP: TestStatSymlinkLoop (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestRemoveAllLarge (0.00s)
        path_test.go:176: skipping in short mode
--- SKIP: TestMkdirAllWithSymlink (0.00s)
        testenv.go:189: skipping test: cannot make symlinks on windows/amd64: you don't have enough privileges to create symlinks
--- SKIP: TestMkdirAllAtSlash (0.00s)
        path_test.go:234: skipping on windows

c:\>

to Administrator runs:

c:\>go test -v -short os | grep -i skip
--- SKIP: TestReaddirNValues (0.00s)
        os_test.go:515: test.short; skipping
--- SKIP: TestReaddirStatFailures (0.00s)
        os_test.go:601: skipping test on windows
--- SKIP: TestLargeWriteToConsole (0.00s)
        os_test.go:1817: skipping console-flooding test; enable with -large_write
--- SKIP: TestSleep (0.00s)
        os_test.go:2072: Skipping in short mode
--- SKIP: TestRemoveAllRace (0.00s)
        os_test.go:2182: skipping on windows
--- SKIP: TestPipeThreads (0.00s)
        os_test.go:2217: skipping on Windows; issue 19098
--- SKIP: TestShareNotExistError (0.00s)
        os_windows_test.go:547: slow test that uses network; skipping
--- SKIP: TestRemoveAllLarge (0.00s)
        path_test.go:176: skipping in short mode
--- SKIP: TestMkdirAllAtSlash (0.00s)
        path_test.go:234: skipping on windows

c:\>

We have 5 windows builders at this moment. Perhaps we could make some run as Administrator to cover more tests.

Thank you.

Alex

@gopherbot gopherbot added this to the Unreleased milestone Jan 1, 2018

@gopherbot gopherbot added the Builders label Jan 1, 2018

@mvdan

This comment has been minimized.

Member

mvdan commented Jan 1, 2018

Do the linux tests run as root? Perhaps this is done on purpose to avoid breaking the machines. Is there a way to grant privileges to create symlinks, but no more?

@bradfitz

This comment has been minimized.

Member

bradfitz commented Jan 1, 2018

Perhaps this is done on purpose to avoid breaking the machines

Naah, we create new ephemeral VMs or containers per build for almost all the builders.

I don't know why Windows runs as a normal user. @johnsonj, you remember?

The Linux builders mostly run as kinda-root: the root that you have in a Kubernetes container, which can do most things, but not all. We used to run a VM-based Linux builder too so we could have real root, but that's been disabled for some time now.

@johnsonj

This comment has been minimized.

Member

johnsonj commented Jan 2, 2018

The only special user thing I remember is we needed to run as a real logged in session and not as SYSTEM. I don't think there is a reason why they can't run as an elevated user.

Does it need to be the actual 'Administrator' user or just a user in the group?

@alexbrainman

This comment has been minimized.

Member

alexbrainman commented Jan 3, 2018

Does it need to be the actual 'Administrator' user or just a user in the group?

I think it needs to be the 'Administrator'. See my original output was produced by the user who is in local 'Administrator' group. And the second output was produced when I started cmd.exe via "Run as Administrator". Just jump on the builder and run some tests that were skipped above and see what you get.

Thank you

Alex

@bradfitz

This comment has been minimized.

Member

bradfitz commented Apr 14, 2018

This bug might be about the opposite now, if I understand #24855 correctly. This bug should be more generally about making sure we test as both admin & non-admin.

@bradfitz bradfitz added the OS-Windows label Apr 14, 2018

@alexbrainman

This comment has been minimized.

Member

alexbrainman commented Apr 14, 2018

This bug should be more generally about making sure we test as both admin & non-admin.

Yes. We do not actually know if builders run as admin or non-admin. So we need to run both kind of builders. It is fine for this bug to be about that.

Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment