diff --git a/.envFiles/2.follower.A.env b/.envFiles/2.follower.A.env index 9c579f0..e529ff5 100644 --- a/.envFiles/2.follower.A.env +++ b/.envFiles/2.follower.A.env @@ -1,6 +1,8 @@ REGISTRY:"http://localhost:9999" ZoneId:2 -HTTP_PORT:"3107" -GRPC_PORT:"3127" -UDP_PORT:"3147" \ No newline at end of file +HTTP_PORT:"3207" +GRPC_PORT:"3227" +UDP_PORT:"3247" + +TempName="Zone-2:Follower-A" diff --git a/.envFiles/2.follower.B.env b/.envFiles/2.follower.B.env index f07c828..43110d1 100644 --- a/.envFiles/2.follower.B.env +++ b/.envFiles/2.follower.B.env @@ -1,6 +1,8 @@ REGISTRY:"http://localhost:9999" ZoneId:2 -HTTP_PORT:"3108" -GRPC_PORT:"3128" -UDP_PORT:"3148" \ No newline at end of file +HTTP_PORT:"3208" +GRPC_PORT:"3228" +UDP_PORT:"3248" + +TempName="Zone-2:Follower-B" \ No newline at end of file diff --git a/.envFiles/3.follower.A.env b/.envFiles/3.follower.A.env new file mode 100644 index 0000000..71c1d9f --- /dev/null +++ b/.envFiles/3.follower.A.env @@ -0,0 +1,8 @@ +REGISTRY:"http://localhost:9999" + +ZoneId:3 +HTTP_PORT:"3307" +GRPC_PORT:"3327" +UDP_PORT:"3347" + +TempName="Zone-3:Follower-A" diff --git a/.envFiles/3.follower.B.env b/.envFiles/3.follower.B.env new file mode 100644 index 0000000..c52357e --- /dev/null +++ b/.envFiles/3.follower.B.env @@ -0,0 +1,8 @@ +REGISTRY:"http://localhost:9999" + +ZoneId:3 +HTTP_PORT:"3308" +GRPC_PORT:"3328" +UDP_PORT:"3348" + +TempName="Zone-3:Follower-B" diff --git a/load_test.go b/load_test.go index 942fff2..26c191e 100644 --- a/load_test.go +++ b/load_test.go @@ -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() @@ -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() @@ -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}...) } diff --git a/main_test.go b/main_test.go index c116869..34f2d84 100644 --- a/main_test.go +++ b/main_test.go @@ -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 diff --git a/utils_test.go b/utils_test.go index 9972e82..731bfa6 100644 --- a/utils_test.go +++ b/utils_test.go @@ -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", }, }