test: parallelize more of TestLeader_ReapOrLeftMember_IgnoreSelf (#12468)

before:

    $ go test ./agent/consul -run TestLeader_ReapOrLeftMember_IgnoreSelf
    ok  	github.com/hashicorp/consul/agent/consul	21.147s

after:

    $ go test ./agent/consul -run TestLeader_ReapOrLeftMember_IgnoreSelf
    ok  	github.com/hashicorp/consul/agent/consul	5.402s
This commit is contained in:
R.B. Boyer 2022-03-01 10:30:06 -06:00 committed by GitHub
parent c60e04e086
commit 033e0ed13f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -275,6 +275,7 @@ func TestLeader_ReapOrLeftMember_IgnoreSelf(t *testing.T) {
t.Parallel()
run := func(t *testing.T, status serf.MemberStatus, nameFn func(string) string) {
t.Parallel()
dir1, s1 := testServerWithConfig(t, func(c *Config) {
c.PrimaryDatacenter = "dc1"
c.ACLsEnabled = true
@ -328,6 +329,7 @@ func TestLeader_ReapOrLeftMember_IgnoreSelf(t *testing.T) {
}
t.Run("original name", func(t *testing.T) {
t.Parallel()
t.Run("left", func(t *testing.T) {
run(t, serf.StatusLeft, nil)
})
@ -337,6 +339,7 @@ func TestLeader_ReapOrLeftMember_IgnoreSelf(t *testing.T) {
})
t.Run("uppercased name", func(t *testing.T) {
t.Parallel()
t.Run("left", func(t *testing.T) {
run(t, serf.StatusLeft, strings.ToUpper)
})