From b9ac13334561ec1902022e9acd67a4e69f6ad66d Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 3 May 2026 11:08:39 +0700 Subject: [PATCH] fix(doctor): raise per-check timeout to 15s for chromium launch 5s could time out the headless chromium check on cold CI. Most checks finish in milliseconds, so a longer ceiling doesn't slow real failures. --- cmd/sanderling/doctor.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/sanderling/doctor.go b/cmd/sanderling/doctor.go index ad94303..cfd579d 100644 --- a/cmd/sanderling/doctor.go +++ b/cmd/sanderling/doctor.go @@ -128,10 +128,16 @@ func parseDoctorArgs(args []string, stderr io.Writer) (doctorOptions, error) { } } +// doctorCheckTimeout bounds a single host-readiness check. Most checks (exec +// lookups, file stats, java -version) finish in milliseconds, but +// checkChromiumLaunch boots a real browser and can exceed 5s on a cold CI +// host - 15s leaves headroom without making real failures feel hung. +const doctorCheckTimeout = 15 * time.Second + func runDoctorChecks(ctx context.Context, checks []doctorCheck, stdout io.Writer) error { failures := 0 for _, check := range checks { - callCtx, cancel := context.WithTimeout(ctx, 5*time.Second) + callCtx, cancel := context.WithTimeout(ctx, doctorCheckTimeout) err := check.Run(callCtx) cancel() if err != nil {