Skip to content

Commit

Permalink
add more test
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Nov 3, 2023
1 parent 41f35c2 commit adc7879
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/integrations/mcs/scheduling/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,21 @@ func TestConfigForward(t *testing.T) {
return len(schedulers) == 5
})

// Test to change config in api server
// Expect to get new config in scheduling server and api server
cluster.GetLeaderServer().GetServer().GetRaftCluster().GetReplicationConfig().MaxReplicas = 4
testutil.Eventually(re, func() bool {
testutil.ReadGetJSON(re, testDialClient, urlPrefix, &cfg)
return cfg["replication"].(map[string]interface{})["max-replicas"] == 4. &&
opts.GetReplicationConfig().MaxReplicas == 4.
})

// Test to change config only in scheduling server
// Expect to get new config in scheduling server but not old config in api server

opts.GetScheduleConfig().LeaderScheduleLimit = 100
re.Equal(100, int(opts.GetLeaderScheduleLimit()))
testutil.ReadGetJSON(re, testDialClient, urlPrefix, &cfg)
re.Equal(100., cfg["schedule"].(map[string]interface{})["leader-schedule-limit"])

opts.GetReplicationConfig().MaxReplicas = 5
re.Equal(5, int(opts.GetReplicationConfig().MaxReplicas))
testutil.ReadGetJSON(re, testDialClient, urlPrefix, &cfg)
Expand Down

0 comments on commit adc7879

Please sign in to comment.