Skip to content

ci: add paralleltestctx to lint/go #19369

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

Merged
merged 1 commit into from
Aug 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ lint/go:
./scripts/check_codersdk_imports.sh
linter_ver=$(shell egrep -o 'GOLANGCI_LINT_VERSION=\S+' dogfood/coder/Dockerfile | cut -d '=' -f 2)
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v$$linter_ver run
go run github.com/coder/paralleltestctx/cmd/paralleltestctx@v0.0.1 -custom-funcs="testutil.Context" ./...
.PHONY: lint/go

lint/examples:
Expand Down
3 changes: 1 addition & 2 deletions agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,6 @@ func TestAgent_GitSSH(t *testing.T) {

func TestAgent_SessionTTYShell(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
t.Cleanup(cancel)
if runtime.GOOS == "windows" {
// This might be our implementation, or ConPTY itself.
// It's difficult to find extensive tests for it, so
Expand All @@ -468,6 +466,7 @@ func TestAgent_SessionTTYShell(t *testing.T) {
for _, port := range sshPorts {
t.Run(fmt.Sprintf("(%d)", port), func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

session := setupSSHSessionOnPort(t, agentsdk.Manifest{}, codersdk.ServiceBannerConfig{}, nil, port)
command := "sh"
Expand Down
4 changes: 3 additions & 1 deletion agent/agentcontainers/containers_dockercli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func TestIntegrationDockerCLI(t *testing.T) {
}, testutil.WaitShort, testutil.IntervalSlow, "Container did not start in time")

dcli := agentcontainers.NewDockerCLI(agentexec.DefaultExecer)
ctx := testutil.Context(t, testutil.WaitMedium) // Longer timeout for multiple subtests
containerName := strings.TrimPrefix(ct.Container.Name, "/")

t.Run("DetectArchitecture", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

arch, err := dcli.DetectArchitecture(ctx, containerName)
require.NoError(t, err, "DetectArchitecture failed")
Expand All @@ -71,6 +71,7 @@ func TestIntegrationDockerCLI(t *testing.T) {

t.Run("Copy", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

want := "Help, I'm trapped!"
tempFile := filepath.Join(t.TempDir(), "test-file.txt")
Expand All @@ -90,6 +91,7 @@ func TestIntegrationDockerCLI(t *testing.T) {

t.Run("ExecAs", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

// Test ExecAs without specifying user (should use container's default).
want := "root"
Expand Down
2 changes: 1 addition & 1 deletion coderd/telemetry/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ func TestTelemetryItem(t *testing.T) {

func TestPrebuiltWorkspacesTelemetry(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitMedium)
db, _ := dbtestutil.NewDB(t)

cases := []struct {
Expand Down Expand Up @@ -435,6 +434,7 @@ func TestPrebuiltWorkspacesTelemetry(t *testing.T) {
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

deployment, snapshot := collectSnapshot(ctx, t, db, func(opts telemetry.Options) telemetry.Options {
opts.Database = tc.storeFn(db)
Expand Down
2 changes: 2 additions & 0 deletions coderd/workspaceapps/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func Test_ResolveRequest(t *testing.T) {
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

// Try resolving a request for each app as the owner, without a
// token, then use the token to resolve each app.
Expand Down Expand Up @@ -589,6 +590,7 @@ func Test_ResolveRequest(t *testing.T) {

t.Run("TokenDoesNotMatchRequest", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

badToken := workspaceapps.SignedToken{
Request: (workspaceapps.Request{
Expand Down
1 change: 1 addition & 0 deletions coderd/workspaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1800,6 +1800,7 @@ func TestWorkspaceFilter(t *testing.T) {
for _, c := range testCases {
t.Run(c.Name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)
workspaces, err := client.Workspaces(ctx, c.Filter)
require.NoError(t, err, "fetch workspaces")

Expand Down
1 change: 1 addition & 0 deletions enterprise/coderd/schedule/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ func TestTemplateUpdateBuildDeadlines(t *testing.T) {
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

user := quietUser
if c.noQuietHours {
Expand Down
1 change: 1 addition & 0 deletions enterprise/wsproxy/wsproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ resourceLoop:

t.Run(r.RegionName, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitShort)

derpMap := &tailcfg.DERPMap{
Regions: map[int]*tailcfg.DERPRegion{
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy