Skip to content

os/user: TestImpersonated and TestGroupIdsTestUser fail #70396

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

Closed
qiulaidongfeng opened this issue Nov 17, 2024 · 3 comments
Closed

os/user: TestImpersonated and TestGroupIdsTestUser fail #70396

qiulaidongfeng opened this issue Nov 17, 2024 · 3 comments
Assignees
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Windows release-blocker Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@qiulaidongfeng
Copy link
Member

Go version

go version devel go1.24-493edb2973 Sat Nov 16 15:10:05 2024 +0000 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=auto
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=D:\file\go-build
set GOENV=C:\Users\26454\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\file\gofile\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\file\gofile
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=D:\file\gofile\gogit\go1
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=local
set GOTOOLDIR=D:\file\gofile\gogit\go1\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.24-375129ab Sat Nov 2 04:21:27 2024 +0000
set GODEBUG=
set GOTELEMETRY=on
set GOTELEMETRYDIR=C:\Users\26454\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v3
set AR=ar
set CC=clang
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\file\gofile\gogit\go1\src\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\26454\AppData\Local\Temp\go-build4078409423=/tmp/go-build -gno-record-gcc-switches

What did you do?

go tool dist test -run=user

What did you see happen?

##### Test execution environment.
# GOARCH: amd64
# CPU: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
# GOOS: windows
# OS Version: 10.0.22631

##### Testing packages.
ok      os/user 0.139s

##### os/user with tag osusergo
--- FAIL: TestImpersonated (0.01s)
    user_windows_test.go:56: The handle is invalid.
--- FAIL: TestGroupIdsTestUser (0.03s)
    user_windows_test.go:76: The user name or password is incorrect.
FAIL
FAIL    os/user 0.172s
FAIL
2024/11/17 19:48:55 Failed: exit status 1

##### Testing without libgcc.
--- FAIL: TestImpersonated (0.03s)
    user_windows_test.go:76: The user name or password is incorrect.
    user_windows_test.go:64: The handle is invalid.
--- FAIL: TestGroupIdsTestUser (0.02s)
    user_windows_test.go:76: The user name or password is incorrect.
FAIL
FAIL    os/user 0.171s
FAIL
2024/11/17 19:48:55 Failed: exit status 1

##### internal linking, -buildmode=pie
--- FAIL: TestImpersonated (0.04s)
    user_windows_test.go:76: The user name or password is incorrect.
--- FAIL: TestGroupIdsTestUser (0.02s)
    user_windows_test.go:76: The user name or password is incorrect.
FAIL
FAIL    os/user 0.173s
FAIL
2024/11/17 19:48:55 Failed: exit status 1
go tool dist: FAILED

What did you expect to see?

test pass

@qiulaidongfeng qiulaidongfeng changed the title os/user: go tool dist test -run=user fail os/user: TestImpersonated and TestGroupIdsTestUser fail Nov 17, 2024
@qmuntal qmuntal self-assigned this Nov 17, 2024
@qmuntal qmuntal added OS-Windows NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Nov 17, 2024
@dmitshur dmitshur added this to the Go1.24 milestone Nov 17, 2024
@qmuntal qmuntal added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 18, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/627877 mentions this issue: os/user: skip tests that create users when running on dev machines

@qmuntal
Copy link
Member

qmuntal commented Nov 18, 2024

The test failures are related to the test setup process rather than the tested code. I've sent CL 627877 with a fix for this issue. It basically skips the tests that creates users on dev machines (so they will only be run now in CI), as depending on the system configuration and permissions, recreating users can get much trickier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done. OS-Windows release-blocker 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

5 participants