Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 5 additions & 3 deletions .envFiles/2.follower.A.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
REGISTRY:"http://localhost:9999"

ZoneId:2
HTTP_PORT:"3107"
GRPC_PORT:"3127"
UDP_PORT:"3147"
HTTP_PORT:"3207"
GRPC_PORT:"3227"
UDP_PORT:"3247"

TempName="Zone-2:Follower-A"
8 changes: 5 additions & 3 deletions .envFiles/2.follower.B.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
REGISTRY:"http://localhost:9999"

ZoneId:2
HTTP_PORT:"3108"
GRPC_PORT:"3128"
UDP_PORT:"3148"
HTTP_PORT:"3208"
GRPC_PORT:"3228"
UDP_PORT:"3248"

TempName="Zone-2:Follower-B"
8 changes: 8 additions & 0 deletions .envFiles/3.follower.A.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REGISTRY:"http://localhost:9999"

ZoneId:3
HTTP_PORT:"3307"
GRPC_PORT:"3327"
UDP_PORT:"3347"

TempName="Zone-3:Follower-A"
8 changes: 8 additions & 0 deletions .envFiles/3.follower.B.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REGISTRY:"http://localhost:9999"

ZoneId:3
HTTP_PORT:"3308"
GRPC_PORT:"3328"
UDP_PORT:"3348"

TempName="Zone-3:Follower-B"
14 changes: 9 additions & 5 deletions load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

const bulkMessages = 100

func Test_Gossip_Load_Single_Round(t *testing.T) {
func Test_Gossip_Load_Single_Zone(t *testing.T) {
ctx, can := context.WithCancel(context.Background())
defer func() {
can()
Expand All @@ -26,7 +26,7 @@ func Test_Gossip_Load_Single_Round(t *testing.T) {
return time.Millisecond * 100
})
}
func Test_Gossip_Load_Multiple_Rounds(t *testing.T) {
func Test_Gossip_Load_Multiple_Zones(t *testing.T) {
ctx, can := context.WithCancel(context.Background())
defer func() {
can()
Expand All @@ -35,7 +35,11 @@ func Test_Gossip_Load_Multiple_Rounds(t *testing.T) {
<-time.After(2 * time.Second)
}()

runTest(t, ctx, zone1, bulkMessages, atAny, func() time.Duration {
return 1 * time.Second
})
// runTest(t, ctx, zone1, bulkMessages, atAny, func() time.Duration {
// return 1 * time.Second
// })

runTestZones(t, ctx, singleRoundNumMessages, atAny, func() time.Duration {
return 500 * time.Millisecond
}, []string{zone2, zone3}...)
}
4 changes: 3 additions & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ func Test_Multiple_Zones(t *testing.T) {
<-time.After(2 * time.Second)
}()

runTestZones(t, ctx, 2, atLeaderOnly, twoSeconds, []string{zone2, zone3}...)
runTestZones(t, ctx, singleRoundNumMessages, atLeaderOnly, func() time.Duration {
return 500 * time.Millisecond
}, []string{zone2, zone3}...)
}

// go test --v ./... -run Test_Round_AtLeader
Expand Down
4 changes: 2 additions & 2 deletions utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ var envFiles = envMap{
// envFile + "2.follower.B.env",
},
envFile + "3.leader.env": []string{
//envFile + "3.follower.A.env",
//envFile + "3.follower.B.env",
// envFile + "3.follower.A.env",
// envFile + "3.follower.B.env",
},
}

Expand Down