Skip to content

Commit

Permalink
test: resolve time race
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Nov 10, 2022
1 parent c417be1 commit 643e88c
Show file tree
Hide file tree
Showing 4 changed files with 372 additions and 985 deletions.
@@ -1 +1 @@
"Usage:\n token the-token [flags]\n\nExamples:\n{{ .CommandPath }} --client-id a0184d6c-b313-4e70-a0b9-905b581e9218 --client-secret Hh1BjioNNm ciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNT\n\nFlags:\n --client-id string Use the provided OAuth 2.0 Client ID, defaults to environment variable OAUTH2_CLIENT_ID\n --client-secret string Use the provided OAuth 2.0 Client Secret, defaults to environment variable OAUTH2_CLIENT_SECRET\n -e, --endpoint string The API URL this command should target. Alternatively set using the ORY_SDK_URL environmental variable.\n --format string Set the output format. One of table, json, yaml, and json-pretty. (default \"default\")\n -h, --help help for token\n -H, --http-header : A list of additional HTTP headers to set. HTTP headers is separated by a : , for example: `-H 'Authorization: bearer some-token'`.\n -q, --quiet Be quiet with output printing.\n --skip-tls-verify Do not verify TLS certificates. Useful when dealing with self-signed certificates. Do not use in production!\n\n\nPlease provide a Client ID and Client Secret using flags --client-id and --client-secret, or environment variables OAUTH2_CLIENT_ID and OAUTH2_CLIENT_SECRET\n"
"Usage:\n token the-token [flags]\n\nExamples:\n{{ .CommandPath }} --client-id a0184d6c-b313-4e70-a0b9-905b581e9218 --client-secret Hh1BjioNNm ciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNT\n\nFlags:\n --client-id string Use the provided OAuth 2.0 Client ID, defaults to environment variable OAUTH2_CLIENT_ID\n --client-secret string Use the provided OAuth 2.0 Client Secret, defaults to environment variable OAUTH2_CLIENT_SECRET\n -e, --endpoint string The API URL this command should target. Alternatively set using the ORY_SDK_URL environmental variable.\n --format string Set the output format. One of table, json, yaml, json-pretty, and jsonpath. (default \"default\")\n -h, --help help for token\n -H, --http-header : A list of additional HTTP headers to set. HTTP headers is separated by a : , for example: `-H 'Authorization: bearer some-token'`.\n -q, --quiet Be quiet with output printing.\n --skip-tls-verify Do not verify TLS certificates. Useful when dealing with self-signed certificates. Do not use in production!\n\n\nPlease provide a Client ID and Client Secret using flags --client-id and --client-secret, or environment variables OAUTH2_CLIENT_ID and OAUTH2_CLIENT_SECRET\n"
4 changes: 3 additions & 1 deletion consent/manager_test_helpers.go
Expand Up @@ -10,6 +10,8 @@ import (
"testing"
"time"

"github.com/ory/x/assertx"

gofrsuuid "github.com/gofrs/uuid"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -472,7 +474,7 @@ func ManagerTests(m Manager, clientManager client.Manager, fositeManager x.Fosit

got1, err = m.HandleConsentRequest(context.Background(), h)
require.NoError(t, err)
require.Equal(t, time.Now().UTC().Round(time.Minute), time.Time(h.HandledAt).Round(time.Minute))
assertx.TimeDifferenceLess(t, time.Now(), time.Time(h.HandledAt), 5)
compareConsentRequest(t, c, got1)

h.GrantedAudience = sqlxx.StringSliceJSONFormat{"new-audience"}
Expand Down

0 comments on commit 643e88c

Please sign in to comment.