Skip to content

Commit

Permalink
test(engine): fix etcd wrong error message when allocating same ports
Browse files Browse the repository at this point in the history
  • Loading branch information
amyangfei committed May 23, 2022
1 parent ab968d8 commit 8525191
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion engine/servermaster/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ func TestStartEtcdTimeout(t *testing.T) {
cfgCluster.Name = name1
cfgCluster.DataDir = dir
peer1 := allocTempURL(t)
peer2 := allocTempURL(t)
peer2 := peer1
require.Eventually(t, func() bool {
peer2 = allocTempURL(t)
return peer2 != peer1
}, time.Second, time.Millisecond*10)
cfgCluster.PeerUrls = "http://" + peer1
cfgCluster.InitialCluster = fmt.Sprintf("%s=http://%s,%s=http://%s", name1, peer1, name2, peer2)
cfgCluster.Adjust("", embed.ClusterStateFlagNew)
Expand Down

0 comments on commit 8525191

Please sign in to comment.