jwk: Resolves MySQL timing issue in tests
@@ -24,6 +24,7 @@ import (
"crypto/rand"
"io"
"testing"
+ "time"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
@@ -66,6 +67,9 @@ func TestHelperManagerKey(m Manager, keys *jose.JSONWebKeySet, suffix string) fu
assert.Nil(t, err)
assert.Equal(t, pub, got.Keys)
+ // Because MySQL
+ time.Sleep(time.Second * 2)
+
First(pub).KeyID = "new-key-id:" + suffix
err = m.AddKey("faz", First(pub))
assert.Nil(t, err)
