Browse Source

test: possibly fix flake in TestIntentionGetExact (#15021)

Restructure test setup to be similar to TestAgent_ServerCertificate
and see if that's enough to avoid flaking after join.
pull/15036/head
R.B. Boyer 2 years ago committed by GitHub
parent
commit
0cca4c088d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      agent/intentions_endpoint_test.go

26
agent/intentions_endpoint_test.go

@ -407,22 +407,22 @@ func TestIntentionGetExact(t *testing.T) {
t.Parallel()
hcl := `
bootstrap = false
bootstrap_expect = 2
server = true
`
a1 := NewTestAgent(t, hcl)
a2 := NewTestAgent(t, hcl)
_, err := a1.JoinLAN([]string{
fmt.Sprintf("127.0.0.1:%d", a2.Config.SerfPortLAN),
}, nil)
a1 := NewTestAgent(t, `
bootstrap = true
server = true
`)
testrpc.WaitForTestAgent(t, a1.RPC, "dc1")
a2 := NewTestAgent(t, `
bootstrap = false
server = true
`)
_, err := a2.JoinLAN([]string{fmt.Sprintf("127.0.0.1:%d", a1.Config.SerfPortLAN)}, nil)
require.NoError(t, err)
testrpc.WaitForTestAgent(t, a1.RPC, "dc1")
testrpc.WaitForTestAgent(t, a2.RPC, "dc1")
testrpc.WaitForLeader(t, a1.RPC, "dc1")
testrpc.WaitForLeader(t, a2.RPC, "dc1")

Loading…
Cancel
Save