Skip to content

chore(agent/agentexec): fix flake in agent/agentexec test #15681

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
Nov 28, 2024
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
7 changes: 1 addition & 6 deletions agent/agentexec/cli_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ import (
"github.com/coder/coder/v2/testutil"
)

//nolint:paralleltest // This test is sensitive to environment variables
func TestCLI(t *testing.T) {
t.Parallel()

t.Run("OK", func(t *testing.T) {
t.Parallel()

ctx := testutil.Context(t, testutil.WaitMedium)
cmd, path := cmd(ctx, t, 123, 12)
err := cmd.Start()
Expand All @@ -40,8 +37,6 @@ func TestCLI(t *testing.T) {
})

t.Run("Defaults", func(t *testing.T) {
t.Parallel()

ctx := testutil.Context(t, testutil.WaitMedium)
cmd, path := cmd(ctx, t, 0, 0)
err := cmd.Start()
Expand Down
10 changes: 5 additions & 5 deletions agent/agentexec/exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestExec(t *testing.T) {
//nolint:paralleltest // we need to test environment variables
t.Run("Disabled", func(t *testing.T) {
if runtime.GOOS != "linux" {
t.Skip("skipping on linux")
t.Skip("skipping on non-linux")
}

cmd, err := agentexec.CommandContext(context.Background(), "sh", "-c", "sleep")
Expand All @@ -52,7 +52,7 @@ func TestExec(t *testing.T) {
t.Setenv(agentexec.EnvProcPrioMgmt, "hello")

if runtime.GOOS != "linux" {
t.Skip("skipping on linux")
t.Skip("skipping on non-linux")
}

executable, err := os.Executable()
Expand All @@ -69,7 +69,7 @@ func TestExec(t *testing.T) {
t.Setenv(agentexec.EnvProcNiceScore, "10")

if runtime.GOOS != "linux" {
t.Skip("skipping on linux")
t.Skip("skipping on non-linux")
}

executable, err := os.Executable()
Expand All @@ -86,7 +86,7 @@ func TestExec(t *testing.T) {
t.Setenv(agentexec.EnvProcOOMScore, "123")

if runtime.GOOS != "linux" {
t.Skip("skipping on linux")
t.Skip("skipping on non-linux")
}

executable, err := os.Executable()
Expand All @@ -104,7 +104,7 @@ func TestExec(t *testing.T) {
t.Setenv(agentexec.EnvProcNiceScore, "14")

if runtime.GOOS != "linux" {
t.Skip("skipping on linux")
t.Skip("skipping on non-linux")
}

executable, err := os.Executable()
Expand Down
Loading