MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / BenchmarkAuthManager_GetValidToken_Cached

Function BenchmarkAuthManager_GetValidToken_Cached

pkg/api/auth_test.go:541–558  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

539}
540
541func BenchmarkAuthManager_GetValidToken_Cached(b *testing.B) {
542 httpClient := &HTTPClient{baseURL: "https://test.example.com"}
543 logger := testutils.NewTestLogger()
544
545 authManager := NewAuthManagerWithPassword(httpClient, "user", "pass", logger)
546 authManager.authToken = &AuthToken{
547 Ticket: "cached-ticket",
548 ExpiresAt: time.Now().Add(1 * time.Hour),
549 }
550
551 ctx := context.Background()
552
553 b.ResetTimer()
554
555 for i := 0; i < b.N; i++ {
556 _, _ = authManager.GetValidToken(ctx)
557 }
558}

Callers

nothing calls this directly

Calls 3

NewTestLoggerFunction · 0.92
GetValidTokenMethod · 0.80

Tested by

no test coverage detected