Skip to content

Commit

Permalink
Run AddMember tests in parallel
Browse files Browse the repository at this point in the history
On my local machine it brings down execution time from 3 minutes to 19s.

Issue: #18983
Signed-off-by: Aleksander Mistewicz <[email protected]>
  • Loading branch information
AwesomePatrol committed Dec 10, 2024
1 parent 39d9cd7 commit ee67c51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/common/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func TestMemberAdd(t *testing.T) {
for _, quorumTc := range quorumTcs {
for _, clusterTc := range clusterTestCases() {
t.Run(learnerTc.name+"/"+quorumTc.name+"/"+clusterTc.name, func(t *testing.T) {
t.Parallel()

ctxTimeout := 10 * time.Second
if quorumTc.waitForQuorum {
ctxTimeout += etcdserver.HealthInterval
Expand Down
4 changes: 4 additions & 0 deletions tests/framework/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ package e2e
import (
"context"
"os"
"sync/atomic"
"testing"

"go.etcd.io/etcd/client/pkg/v3/testutil"
"go.etcd.io/etcd/tests/v3/framework/config"
intf "go.etcd.io/etcd/tests/v3/framework/interfaces"
)

var uniqueBasePort int32 = 20000

type e2eRunner struct{}

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

0 comments on commit ee67c51

Please sign in to comment.