Skip to content

timesleepnocontext enforce-readiness: zero production violations after the defer-cleanup FP fix — add to CI #39324

Description

@github-actions

Summary

timesleepnocontext (26th custom linter) is registered in cmd/linters/main.go and documented, but is not in the CI-enforced analyzer set. An enforce-readiness sweep of its entire run scope (./cmd/... ./pkg/...) shows it is essentially clean: the only production site it flags is the deferred-cleanup false positive tracked separately. Once that FP is excluded, zero production violations remain, so the analyzer can be enforced by appending one flag.

Current CI state

.github/workflows/cgo.yml:1123 runs make golint-custom with 14 enforced flags:

-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib
-regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror
-uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak

-timesleepnocontext is absent.

Evidence — full-scope sweep

All 11 non-test time.Sleep calls under ./cmd/... and ./pkg/... mapped to their enclosing function's signature:

Site Enclosing function Has context.Context param?
pkg/workflow/docker_validation.go:219 validateDockerImage(image, verbose, requireDocker) no
pkg/cli/run_workflow_tracking.go:73 getLatestWorkflowRunWithRetry(lockFileName, repo, verbose) no
pkg/cli/trial_repository.go:156 ensureTrialRepository(...) no
pkg/cli/logs_rate_limit.go:87/97/110/121 checkAndWaitForRateLimit(verbose) no
pkg/cli/mcp_inspect_inspector.go:164/208 spawnMCPInspector(workflowFile, serverFilter, verbose) no
pkg/cli/update_extension_check.go:411 cleanupStaleWindowsBackups(extDir, ownBackup) no
pkg/cli/mcp_inspect.go:138 InspectWorkflowMCP(ctx, ...) via deferred cleanup closure yes — false positive (see precision issue)

No production function with a real context.Context parameter contains a genuinely cancellable time.Sleep. (Note: checkAndWaitForRateLimit arguably should take a ctx, but that is a design change outside this analyzer's detection.)

Recommendation

  1. Land the precision fix first (deferred-cleanup FP carve-out) so mcp_inspect.go:138 is no longer reported.
  2. Append -timesleepnocontext to the LINTER_FLAGS in .github/workflows/cgo.yml:1123.
  3. Confirm make golint-custom LINTER_FLAGS="-timesleepnocontext -test=false" reports zero violations.

This follows the proven zero-violation enforce pattern used for fileclosenotdeferred (#35390), osexitinlibrary/rawloginlib (#35130), httpnoctx (#39016), and timeafterleak (now enforced).

Blocked by: the deferred-cleanup precision fix (companion issue). Effort: small once unblocked — one CI flag append.

Validation checklist
  • Precision FP fix merged.
  • -timesleepnocontext added to cgo.yml LINTER_FLAGS.
  • CI green with the new flag.

Generated by 🤖 Sergo - Serena Go Expert · 280.5 AIC · ⌖ 13.9 AIC · ⊞ 5.3K ·

  • expires on Jun 21, 2026, 9:37 PM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions