Skip to content

Commit 6cb6a25

Browse files
committed
lest see
1 parent 872f60a commit 6cb6a25

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

cmd/lakectl/cmd/token_cacing_test.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@ import (
2121
"github.com/treeverse/lakefs/pkg/logging"
2222
)
2323

24-
func resetGlobalState() {
25-
tokenLoadOnce = sync.Once{}
26-
tokenCacheOnce = sync.Once{}
27-
tokenSaveOnce = sync.Once{}
28-
cachedToken = nil
29-
tokenCache = nil
30-
31-
homeDir := os.Getenv("HOME")
32-
if homeDir != "" {
33-
cacheDir := filepath.Join(homeDir, ".lakectl", "cache")
34-
os.RemoveAll(cacheDir)
35-
}
36-
}
37-
3824
func TestGetTokenCacheOnce(t *testing.T) {
3925
t.Run("creates cache on first call ONLY", func(t *testing.T) {
4026
resetGlobalState()
@@ -210,6 +196,19 @@ func TestTokenExpiredWrite(t *testing.T) {
210196
require.Nil(t, token)
211197
})
212198
}
199+
func resetGlobalState() {
200+
tokenLoadOnce = sync.Once{}
201+
tokenCacheOnce = sync.Once{}
202+
tokenSaveOnce = sync.Once{}
203+
cachedToken = nil
204+
tokenCache = nil
205+
206+
homeDir := os.Getenv("HOME")
207+
if homeDir != "" {
208+
cacheDir := filepath.Join(homeDir, ".lakectl", "cache")
209+
os.RemoveAll(cacheDir)
210+
}
211+
}
213212

214213
func setupTestHomeDir(t *testing.T) (cleanup func()) {
215214
tempDir := t.TempDir()

0 commit comments

Comments
 (0)