Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(engine): fix start etcd test failure because of duplicated free port #5516

Merged
merged 3 commits into from
May 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main reason we get this error is peer1 is not used when allocate peer2.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change the pr discription before merge this pr.

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