As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit ba847e42 authored by Patrick Bajao's avatar Patrick Bajao
Browse files

Merge branch 'id-fix-flacky-test' into 'main'

Use require.WithinDuration to fix flaky test

See merge request gitlab-org/gitlab-shell!617
parents 970d533e f621eb30
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -196,8 +196,8 @@ func testJWTAuthenticationHeader(t *testing.T, client *GitlabNetClient) {
require.NoError(t, err)
require.True(t, token.Valid)
require.Equal(t, "gitlab-shell", claims.Issuer)
require.Equal(t, time.Now().Truncate(time.Second), claims.IssuedAt.Time, time.Second)
require.Equal(t, time.Now().Truncate(time.Second).Add(time.Minute), claims.ExpiresAt.Time, time.Second)
require.WithinDuration(t, time.Now().Truncate(time.Second), claims.IssuedAt.Time, time.Second)
require.WithinDuration(t, time.Now().Truncate(time.Second).Add(time.Minute), claims.ExpiresAt.Time, time.Second)
}
t.Run("JWT authentication headers for GET", func(t *testing.T) {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment