diff --git a/scnserver/test/requestlog_test.go b/scnserver/test/requestlog_test.go index 6ad9e4f..7287bfc 100644 --- a/scnserver/test/requestlog_test.go +++ b/scnserver/test/requestlog_test.go @@ -130,20 +130,19 @@ func TestRequestLogAPI(t *testing.T) { defer stop() data := tt.InitDefaultData(t, ws) - time.Sleep(100 * time.Millisecond) + time.Sleep(900 * time.Millisecond) ctx := ws.NewSimpleTransactionContext(5 * time.Second) defer ctx.Cancel() rl1, _, err := ws.Database.Requests.ListRequestLogs(ctx, models.RequestLogFilter{}, nil, ct.Start()) tt.TestFailIfErr(t, err) - time.Sleep(100 * time.Millisecond) tt.RequestAuthGet[gin.H](t, data.User[0].ReadKey, baseUrl, "/api/v2/users/"+data.User[0].UID) + time.Sleep(900 * time.Millisecond) rl2, _, err := ws.Database.Requests.ListRequestLogs(ctx, models.RequestLogFilter{}, nil, ct.Start()) tt.TestFailIfErr(t, err) - time.Sleep(100 * time.Millisecond) tt.AssertEqual(t, "requestlog.count", len(rl1)+1, len(rl2)) } diff --git a/scnserver/test/response_test.go b/scnserver/test/response_test.go index dc44ea5..3bb290f 100644 --- a/scnserver/test/response_test.go +++ b/scnserver/test/response_test.go @@ -42,7 +42,7 @@ func TestResponseClient(t *testing.T) { data := tt.InitDefaultData(t, ws) - response := tt.RequestAuthGetRaw(t, data.User[0].AdminKey, baseUrl, fmt.Sprintf("/api/v2/users/%s/clients/%s", data.User[0].UID, data.User[0].Clients[0])) + response := tt.RequestAuthGetRaw(t, data.User[0].AdminKey, baseUrl, fmt.Sprintf("/api/v2/users/%s/clients/%s", data.User[2].UID, data.User[2].Clients[2])) tt.AssertJsonStructureMatch(t, "json[client]", response, map[string]any{}) }