mirror of
https://github.com/smallstep/certificates.git
synced 2024-10-31 03:20:16 +00:00
Fix tests when we create re-use a token with a new authority.
This commit is contained in:
parent
08115f584c
commit
097a918da7
@ -11,6 +11,7 @@ import (
|
||||
"net"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/smallstep/assert"
|
||||
@ -82,6 +83,10 @@ func testAuthority(t *testing.T, opts ...Option) *Authority {
|
||||
}
|
||||
a, err := New(c, opts...)
|
||||
assert.FatalError(t, err)
|
||||
// Avoid errors when test tokens are created before the test authority. This
|
||||
// happens in some tests where we re-create the same authority to test
|
||||
// special cases without re-creating the token.
|
||||
a.startTime = a.startTime.Add(-1 * time.Minute)
|
||||
return a
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user