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/sys/windows: TestGetKeyboardLayout failures [consistent failure] #68671

Closed
gopherbot opened this issue Jul 31, 2024 · 17 comments
Closed

x/sys/windows: TestGetKeyboardLayout failures [consistent failure] #68671

gopherbot opened this issue Jul 31, 2024 · 17 comments
Labels
arch-arm64 compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@gopherbot
Copy link
Contributor

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"

Issue created automatically to collect these failures.

Example (log):

=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot gopherbot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 31, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 31, 2024
@gopherbot gopherbot added this to the Unreleased milestone Jul 31, 2024
@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-17 07:58 x_sys-go1.21-windows-arm64 sys@bce4cf76 release-branch.go1.21@e073febe x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-17 07:58 x_sys-go1.22-windows-arm64 sys@bce4cf76 release-branch.go1.22@4b27560d x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-17 07:58 x_sys-go1.23-windows-arm64 sys@bce4cf76 release-branch.go1.23@30b6fd60 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-17 17:57 x_sys-go1.21-windows-arm64 sys@7bb0bf70 release-branch.go1.21@dabed2e0 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-17 17:57 x_sys-go1.22-windows-arm64 sys@7bb0bf70 release-branch.go1.22@4c50f916 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-17 17:57 x_sys-go1.23-windows-arm64 sys@7bb0bf70 release-branch.go1.23@f5e4e45e x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-22 20:52 x_sys-go1.21-windows-arm64 sys@beb59498 release-branch.go1.21@dabed2e0 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-22 20:52 x_sys-go1.22-windows-arm64 sys@beb59498 release-branch.go1.22@4c50f916 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-22 20:52 x_sys-go1.23-windows-arm64 sys@beb59498 release-branch.go1.23@90c6558b x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 15:35 x_sys-go1.21-windows-arm64 sys@d03a8072 release-branch.go1.21@dabed2e0 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 15:35 x_sys-go1.22-windows-arm64 sys@d03a8072 release-branch.go1.22@70a1aae6 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 15:35 x_sys-go1.23-windows-arm64 sys@d03a8072 release-branch.go1.23@f5e4e45e x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 16:33 x_sys-go1.21-windows-arm64 sys@31ef9e72 release-branch.go1.21@dabed2e0 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 16:33 x_sys-go1.22-windows-arm64 sys@31ef9e72 release-branch.go1.22@70a1aae6 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 16:33 x_sys-go1.23-windows-arm64 sys@31ef9e72 release-branch.go1.23@c9940fe2 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-29 14:24 x_sys-go1.21-windows-arm64 sys@cde4660e release-branch.go1.21@dabed2e0 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-29 14:24 x_sys-go1.22-windows-arm64 sys@cde4660e release-branch.go1.22@70a1aae6 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-29 14:24 x_sys-go1.23-windows-arm64 sys@cde4660e release-branch.go1.23@c9940fe2 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@cherrymui
Copy link
Member

cherrymui commented Jul 31, 2024

The windows arm64 builder seems failing consistently since CL 574755.

cc @aymanbagabas @alexbrainman @golang/windows

@aymanbagabas
Copy link

It works fine locally on go version go1.22.4 windows/arm64. Could we use GetLastError() to get more context on the error?

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-17 07:58 x_sys-gotip-windows-arm64 sys@bce4cf76 go@fc51e502 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-17 17:57 x_sys-gotip-windows-arm64 sys@7bb0bf70 go@a799fa51 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-22 20:52 x_sys-gotip-windows-arm64 sys@beb59498 go@e76353d5 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 15:35 x_sys-gotip-windows-arm64 sys@d03a8072 go@bd6f911f x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-24 16:33 x_sys-gotip-windows-arm64 sys@31ef9e72 go@0fe775e9 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-29 14:24 x_sys-go1.22-windows-arm64 sys@cde4660e release-branch.go1.22@8c8adffd x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@ecadbe9f x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@alexbrainman
Copy link
Member

It works fine locally on go version go1.22.4 windows/arm64.

I am glad it works for you. But we still need to fix the builder.

Could we use GetLastError() to get more context on the error?

It fails with

=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

and displayed GetWindowThreadProcessId error is returned by the GetLastError function.

I just looked at GetForegroundWindow docs https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getforegroundwindow and it says

The return value is a handle to the foreground window. The foreground window can be NULL in certain circumstances, such as when a window is losing activation.

I suspect what happens here is that the windows/arm64 builder returns nil from GetForegroundWindow, and that is why GetWindowThreadProcessId fails.

I will send a CL to remove the TestGetKeyboardLayout.

Alex

@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/602335 mentions this issue: windows: delete TestGetKeyboardLayout

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@11dbbaff x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@a9ad4108 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@3a55b92c x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@aac7106c x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@2ca1ae8e x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@b874005a x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@40876244 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-07-29 14:24 x_sys-gotip-windows-arm64 sys@cde4660e go@f428c7b7 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-08-03 07:06 x_sys-go1.22-windows-arm64 sys@aa1c4c85 release-branch.go1.22@8c8adffd x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)
2024-08-03 07:06 x_sys-gotip-windows-arm64 sys@aa1c4c85 go@f428c7b7 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-08-03 07:06 x_sys-gotip-windows-arm64 sys@aa1c4c85 go@d465aee0 x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@gopherbot
Copy link
Contributor Author

Found new dashboard test flakes for:

#!watchflakes
default <- pkg == "golang.org/x/sys/windows" && test == "TestGetKeyboardLayout"
2024-08-03 07:06 x_sys-gotip-windows-arm64 sys@aa1c4c85 go@677e080d x/sys/windows.TestGetKeyboardLayout (log)
=== RUN   TestGetKeyboardLayout
    syscall_windows_test.go:1445: GetWindowThreadProcessId failed: Invalid window handle.
--- FAIL: TestGetKeyboardLayout (0.00s)

watchflakes

@dmitshur dmitshur added Testing An issue that has been verified to require only test changes, not just a test failure. 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 Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm64 compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done. OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
Archived in project
Development

No branches or pull requests

5 participants