Truncate instead of round timestamps so our tests that require a time to pass can succeed. (#224)
This commit is contained in:
1 parent
25514fb553
commit
a0bed2b5d7
1 file changed
+2
-2
@@ -86,9 +86,9 @@ func (r *Repository) CreateAuthToken(ctx context.Context, withIamUserId, withAut
|
||||
at.Token = token
|
||||
|
||||
// TODO: Allow the caller to specify something different than the default duration.
|
||||
// We round the expiration time to the nearest second to make testing in different platforms with
|
||||
// We truncate the expiration time to the nearest second to make testing in different platforms with
|
||||
// different time resolutions easier.
|
||||
expiration, err := ptypes.TimestampProto(time.Now().Round(time.Second).Add(maxTokenDuration))
|
||||
expiration, err := ptypes.TimestampProto(time.Now().Add(maxTokenDuration).Truncate(time.Second))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user