mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 17:07:16 +00:00
* chore: Upgrade Go module to v2 Signed-off-by: jannfis <jann@mistrust.net> * Restore import order Signed-off-by: jannfis <jann@mistrust.net> * fix knowntypes_normalizer codegen error Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com> * fix codegen Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com> * fix Procfile Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com> Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
29 lines
627 B
Go
29 lines
627 B
Go
package session
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/argoproj/argo-cd/v2/test"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestUserStateStorage_LoadRevokedTokens(t *testing.T) {
|
|
redis, closer := test.NewInMemoryRedis()
|
|
defer closer()
|
|
|
|
err := redis.Set(context.Background(), revokedTokenPrefix+"abc", "", time.Hour).Err()
|
|
require.NoError(t, err)
|
|
|
|
ctx, cancel := context.WithCancel(context.Background())
|
|
defer cancel()
|
|
|
|
storage := NewUserStateStorage(redis)
|
|
storage.Init(ctx)
|
|
time.Sleep(time.Millisecond * 100)
|
|
|
|
assert.True(t, storage.IsTokenRevoked("abc"))
|
|
}
|