Skip to content

Commit ee67c51

Browse files
committed
Run AddMember tests in parallel
On my local machine it brings down execution time from 3 minutes to 19s. Issue: #18983 Signed-off-by: Aleksander Mistewicz <[email protected]>
1 parent 39d9cd7 commit ee67c51

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tests/common/member_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ func TestMemberAdd(t *testing.T) {
113113
for _, quorumTc := range quorumTcs {
114114
for _, clusterTc := range clusterTestCases() {
115115
t.Run(learnerTc.name+"/"+quorumTc.name+"/"+clusterTc.name, func(t *testing.T) {
116+
t.Parallel()
117+
116118
ctxTimeout := 10 * time.Second
117119
if quorumTc.waitForQuorum {
118120
ctxTimeout += etcdserver.HealthInterval

tests/framework/e2e/e2e.go

+4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ package e2e
1717
import (
1818
"context"
1919
"os"
20+
"sync/atomic"
2021
"testing"
2122

2223
"go.etcd.io/etcd/client/pkg/v3/testutil"
2324
"go.etcd.io/etcd/tests/v3/framework/config"
2425
intf "go.etcd.io/etcd/tests/v3/framework/interfaces"
2526
)
2627

28+
var uniqueBasePort int32 = 20000
29+
2730
type e2eRunner struct{}
2831

2932
func NewE2eRunner() intf.TestRunner {
@@ -83,6 +86,7 @@ func (e e2eRunner) NewCluster(ctx context.Context, t testing.TB, opts ...config.
8386
default:
8487
t.Fatalf("PeerTLS config %q not supported", cfg.PeerTLS)
8588
}
89+
e2eConfig.BasePort = int(atomic.AddInt32(&uniqueBasePort, int32(cfg.ClusterSize+2)*5))
8690
epc, err := NewEtcdProcessCluster(ctx, t, WithConfig(e2eConfig))
8791
if err != nil {
8892
t.Fatalf("could not start etcd integrationCluster: %s", err)

0 commit comments

Comments
 (0)