Skip to content

Commit

Permalink
fix TestAPI
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <rleungx@gmail.com>
  • Loading branch information
rleungx committed Apr 7, 2024
1 parent 7179657 commit 50a137e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/server/api/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
body, err := json.Marshal(dataMap)
re.NoError(err)
re.NoError(tu.CheckPostJSON(testDialClient, updateURL, body, tu.StatusOK(re)))
resp = make(map[string]any)
re.NoError(tu.ReadGetJSON(re, testDialClient, listURL, &resp))

for key := range expectMap {
re.Equal(expectMap[key], resp[key], "key %s", key)
}
tu.Eventually(re, func() bool {
resp = make(map[string]any)
re.NoError(tu.ReadGetJSON(re, testDialClient, listURL, &resp))
return expectMap["max-zombie-rounds"] == resp["max-zombie-rounds"] &&
expectMap["min-hot-byte-rate"] == resp["min-hot-byte-rate"]
})

// update again
err = tu.CheckPostJSON(testDialClient, updateURL, body,
Expand Down

0 comments on commit 50a137e

Please sign in to comment.