mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(agent/agentexec): fix flake in agent/agentexec test (#15681)
Should hopefully fix https://github.com/coder/internal/issues/233
This commit is contained in:
@@ -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()
|
||||
@@ -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()
|
||||
|
||||
@@ -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")
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user