From 6f2cf65d49e07512248d50573c101c320efa4541 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 4 Oct 2024 14:39:37 +0100 Subject: [PATCH] Fix the tests hanging on the open channel. --- main.go | 1 - main_test.go | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index ac1df78..47b4b56 100644 --- a/main.go +++ b/main.go @@ -266,7 +266,6 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h t.jwtVerifier = t t.startTokenCleanup() go t.initializeMetadata(config.ProviderURL) - return t, nil } diff --git a/main_test.go b/main_test.go index 7923bac..a6bfd5c 100644 --- a/main_test.go +++ b/main_test.go @@ -95,8 +95,9 @@ func (ts *TestSuite) Setup() { httpClient: &http.Client{}, exchangeCodeForTokenFunc: ts.exchangeCodeForTokenFunc, extractClaimsFunc: extractClaims, + initComplete: make(chan struct{}), } - + close(ts.tOidc.initComplete) ts.tOidc.tokenVerifier = ts.tOidc ts.tOidc.jwtVerifier = ts.tOidc }