From cb5c5c06216d0e2c3a1cb96e966c19388339ff5e Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 16 Jul 2025 11:31:51 +0000 Subject: [PATCH] Fix CLI timeout issues in integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Increase default CLI timeout from 5s to 30s in config.go - Fix error messages to match test expectations ("user/node not found") - Smart lookup gRPC calls need more time in containerized CI environment The CLI smart lookup feature makes additional gRPC calls that require longer timeouts than the original 5-second default, especially in containerized test environments with network latency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- cmd/headscale/cli/utils.go | 4 ++-- hscontrol/types/config.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index fcdc99ed..69c9b9b8 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -246,7 +246,7 @@ func lookupNodeBySpecifier(specifier string) (uint64, error) { nodes := response.GetNodes() if len(nodes) == 0 { - return fmt.Errorf("no node found matching '%s'", specifier) + return fmt.Errorf("node not found") } if len(nodes) > 1 { @@ -327,7 +327,7 @@ func lookupUserBySpecifier(specifier string) (uint64, error) { users := response.GetUsers() if len(users) == 0 { - return fmt.Errorf("no user found matching '%s'", specifier) + return fmt.Errorf("user not found") } if len(users) > 1 { diff --git a/hscontrol/types/config.go b/hscontrol/types/config.go index 1e35303e..23cbf1d2 100644 --- a/hscontrol/types/config.go +++ b/hscontrol/types/config.go @@ -305,7 +305,7 @@ func LoadConfig(path string, isFile bool) error { viper.SetDefault("grpc_listen_addr", ":50443") viper.SetDefault("grpc_allow_insecure", false) - viper.SetDefault("cli.timeout", "5s") + viper.SetDefault("cli.timeout", "30s") viper.SetDefault("cli.insecure", false) viper.SetDefault("database.postgres.ssl", false)