Skip to content

Commit

Permalink
remove all t.Parallel calls from tests
Browse files Browse the repository at this point in the history
Tests take near the same time without and are much easier to work with
and debug if they are sequential.
  • Loading branch information
eikenb committed Jul 29, 2021
1 parent 0b1d208 commit e4a17d2
Show file tree
Hide file tree
Showing 42 changed files with 0 additions and 190 deletions.
17 changes: 0 additions & 17 deletions child/child_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func testChild(t *testing.T) *Child {
}

func TestNew(t *testing.T) {
t.Parallel()

stdin := gatedio.NewByteBuffer()
stdout := gatedio.NewByteBuffer()
Expand Down Expand Up @@ -106,7 +105,6 @@ func TestNew(t *testing.T) {
}

func TestNew_errMissingCommand(t *testing.T) {
t.Parallel()

_, err := New(nil)
if err == nil {
Expand All @@ -119,7 +117,6 @@ func TestNew_errMissingCommand(t *testing.T) {
}

func TestExitCh_noProcess(t *testing.T) {
t.Parallel()

c := testChild(t)
ch := c.ExitCh()
Expand All @@ -129,7 +126,6 @@ func TestExitCh_noProcess(t *testing.T) {
}

func TestExitCh(t *testing.T) {
t.Parallel()

c := testChild(t)
if err := c.Start(); err != nil {
Expand All @@ -144,7 +140,6 @@ func TestExitCh(t *testing.T) {
}

func TestPid_noProcess(t *testing.T) {
t.Parallel()

c := testChild(t)
pid := c.Pid()
Expand All @@ -154,7 +149,6 @@ func TestPid_noProcess(t *testing.T) {
}

func TestPid(t *testing.T) {
t.Parallel()

c := testChild(t)
if err := c.Start(); err != nil {
Expand All @@ -169,7 +163,6 @@ func TestPid(t *testing.T) {
}

func TestStart(t *testing.T) {
t.Parallel()

c := testChild(t)

Expand Down Expand Up @@ -204,7 +197,6 @@ func TestStart(t *testing.T) {
}

func TestSignal(t *testing.T) {
t.Parallel()

c := testChild(t)
c.command = "sh"
Expand Down Expand Up @@ -235,7 +227,6 @@ func TestSignal(t *testing.T) {
}

func TestSignal_noProcess(t *testing.T) {
t.Parallel()

c := testChild(t)
if err := c.Signal(syscall.SIGUSR1); err != nil {
Expand All @@ -245,7 +236,6 @@ func TestSignal_noProcess(t *testing.T) {
}

func TestReload_signal(t *testing.T) {
t.Parallel()

c := testChild(t)
c.command = "sh"
Expand Down Expand Up @@ -277,7 +267,6 @@ func TestReload_signal(t *testing.T) {
}

func TestReload_noSignal(t *testing.T) {
t.Parallel()

c := testChild(t)
c.command = "sh"
Expand Down Expand Up @@ -312,7 +301,6 @@ func TestReload_noSignal(t *testing.T) {
}

func TestReload_noProcess(t *testing.T) {
t.Parallel()

c := testChild(t)
c.reloadSignal = syscall.SIGUSR1
Expand All @@ -322,7 +310,6 @@ func TestReload_noProcess(t *testing.T) {
}

func TestKill_signal(t *testing.T) {
t.Parallel()

c := testChild(t)
c.command = "sh"
Expand Down Expand Up @@ -352,7 +339,6 @@ func TestKill_signal(t *testing.T) {
}

func TestKill_noSignal(t *testing.T) {
t.Parallel()

c := testChild(t)
c.command = "sh"
Expand All @@ -379,15 +365,13 @@ func TestKill_noSignal(t *testing.T) {
}

func TestKill_noProcess(t *testing.T) {
t.Parallel()

c := testChild(t)
c.killSignal = syscall.SIGUSR1
c.Kill()
}

func TestStop_noWaitForSplay(t *testing.T) {
t.Parallel()
c := testChild(t)
c.command = "sh"
c.args = []string{"-c", "trap 'echo one; exit' USR1; while true; do sleep 0.2; done"}
Expand Down Expand Up @@ -420,7 +404,6 @@ func TestStop_noWaitForSplay(t *testing.T) {
}

func TestStop_childAlreadyDead(t *testing.T) {
t.Parallel()
c := testChild(t)
c.command = "sh"
c.args = []string{"-c", "exit 1"}
Expand Down
4 changes: 0 additions & 4 deletions cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
)

func TestCLI_ParseFlags(t *testing.T) {
t.Parallel()

f, err := ioutil.TempFile("", "")
if err != nil {
Expand Down Expand Up @@ -736,7 +735,6 @@ func TestCLI_ParseFlags(t *testing.T) {
}

func TestCLI_Run(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -787,7 +785,6 @@ func TestCLI_Run(t *testing.T) {
}

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

f, err := ioutil.TempFile("", "")
if err != nil {
Expand Down Expand Up @@ -839,7 +836,6 @@ func TestCLI_Run(t *testing.T) {
})

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

f, err := ioutil.TempFile("", "")
if err != nil {
Expand Down
5 changes: 0 additions & 5 deletions config/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
)

func TestParseAuthConfig(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -54,7 +53,6 @@ func TestParseAuthConfig(t *testing.T) {
}

func TestAuthConfig_Copy(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -89,7 +87,6 @@ func TestAuthConfig_Copy(t *testing.T) {
}

func TestAuthConfig_Merge(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -206,7 +203,6 @@ func TestAuthConfig_Merge(t *testing.T) {
}

func TestAuthConfig_Finalize(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -246,7 +242,6 @@ func TestAuthConfig_Finalize(t *testing.T) {
}

func TestAuthConfig_String(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down
4 changes: 0 additions & 4 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func testFile(t *testing.T, contents string) (path string, remove func()) {
}

func TestParse(t *testing.T) {
t.Parallel()

testFilePath, remove := testFile(t, "")
defer remove()
Expand Down Expand Up @@ -1571,7 +1570,6 @@ func TestParse(t *testing.T) {
}

func TestFinalize(t *testing.T) {
t.Parallel()

testFileContents := "testing123"
testFilePath, remove := testFile(t, testFileContents)
Expand Down Expand Up @@ -1676,7 +1674,6 @@ func TestFinalize(t *testing.T) {
}

func TestConfig_Merge(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -1943,7 +1940,6 @@ func TestConfig_Merge(t *testing.T) {
}

func TestFromPath(t *testing.T) {
t.Parallel()

f, err := ioutil.TempFile("", "")
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions config/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
)

func TestConsulConfig_Copy(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -49,7 +48,6 @@ func TestConsulConfig_Copy(t *testing.T) {
}

func TestConsulConfig_Merge(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down Expand Up @@ -262,7 +260,6 @@ func TestConsulConfig_Merge(t *testing.T) {
}

func TestConsulConfig_Finalize(t *testing.T) {
t.Parallel()

cases := []struct {
name string
Expand Down
Loading

0 comments on commit e4a17d2

Please sign in to comment.