From 4fc31f5604e012ae3b02a18c903156d6ef1ddfe2 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Fri, 20 Nov 2026 00:19:22 +0900 Subject: internal/testsuite: notify on long sway polls This prints a message every second for a long-running sway poll. Signed-off-by: Ophestra --- cmd/hakurei/testsuite/main.go | 6 +++--- internal/testsuite/testsuite.go | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/hakurei/testsuite/main.go b/cmd/hakurei/testsuite/main.go index c3cada17..7f8a14b3 100644 --- a/cmd/hakurei/testsuite/main.go +++ b/cmd/hakurei/testsuite/main.go @@ -503,7 +503,7 @@ func main() { n.ID == "app.hakurei.wayland-client" && n.Instance == p.ID && n.AppID == "foot" - }) + }, "wayland client") return nil }, func(string) bool { return true }, 230, ) @@ -549,13 +549,13 @@ func main() { c.DirectWayland = true c.Container.Path = prefix.Append("bin", "foot") c.Container.Args = []string{"foot"} - }, func(p hst.State, pid int) error { + }, func(_ hst.State, _ int) error { testsuite.PollSwayWindow(ctx, &cred, func(n *testsuite.SwayNode) bool { return n.Sandbox == "" && n.ID == "" && n.Instance == hst.ID{} && n.AppID == "foot" - }) + }, "direct wayland client") return nil }, func(string) bool { return true }, 230, ) diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go index 30c21df8..0b7594ba 100644 --- a/internal/testsuite/testsuite.go +++ b/internal/testsuite/testsuite.go @@ -537,7 +537,16 @@ func PollSwayWindow( ctx context.Context, cred *syscall.Credential, f func(n *SwayNode) bool, + name string, ) *SwayNode { + m := time.NewTicker(1 * time.Second) + defer m.Stop() + go func() { + for range m.C { + log.Printf("still polling %s", name) + } + }() + var t SwayNode for { time.Sleep(25 * time.Millisecond) -- cgit v1.3.1