Перенести пользователей в PostgreSQL и добавить пароли
This commit is contained in:
@@ -121,6 +121,9 @@ func run(baseURL string, clients, perClient int) (Report, error) {
|
||||
return report, nil
|
||||
}
|
||||
|
||||
// clientPassword is shared by the synthetic clients of one run.
|
||||
const clientPassword = "concurrency-check-password"
|
||||
|
||||
func registerClients(api *client, runID string, n int) ([]string, error) {
|
||||
ids := make([]string, 0, n)
|
||||
for i := range n {
|
||||
@@ -128,6 +131,7 @@ func registerClients(api *client, runID string, n int) ([]string, error) {
|
||||
body := map[string]string{
|
||||
"username": fmt.Sprintf("load_%s_%d", runID, i),
|
||||
"display_name": fmt.Sprintf("Load client %d", i),
|
||||
"password": clientPassword,
|
||||
}
|
||||
if err := api.post("/api/v1/users", "", body, &created); err != nil {
|
||||
return nil, fmt.Errorf("register client %d: %w", i, err)
|
||||
|
||||
Reference in New Issue
Block a user