Skip to content

Commit

Permalink
Add a fakeclock to fix access request time diff check differences
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlisa committed Mar 22, 2024
1 parent b19ae93 commit 30fa6d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tool/tsh/common/kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/uuid"
"github.com/gravitational/trace"
"github.com/jonboulle/clockwork"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -365,6 +366,7 @@ func TestKubeSelection(t *testing.T) {
cfg.Kube.ResourceMatchers = []services.ResourceMatcher{{
Labels: map[string]apiutils.Strings{"*": {"*"}},
}}
cfg.Clock = clockwork.NewFakeClock()
}),
)
kubeBarEKS := "bar-eks-us-west-1-123456789012"
Expand Down
7 changes: 6 additions & 1 deletion tool/tsh/common/tsh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (

"github.com/ghodss/yaml"
"github.com/gravitational/trace"
"github.com/jonboulle/clockwork"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
otlp "go.opentelemetry.io/proto/otlp/trace/v1"
Expand Down Expand Up @@ -1808,7 +1809,11 @@ func TestSSHAccessRequest(t *testing.T) {
}
alice.SetTraits(traits)

rootAuth, rootProxy := makeTestServers(t, withBootstrap(requester, nodeAccessRole, connector, alice))
rootAuth, rootProxy := makeTestServers(t,
withBootstrap(requester, nodeAccessRole, connector, alice),
withConfig(func(cfg *servicecfg.Config) {
cfg.Clock = clockwork.NewFakeClock()
}))

authAddr, err := rootAuth.AuthAddr()
require.NoError(t, err)
Expand Down

0 comments on commit 30fa6d0

Please sign in to comment.