Merge pull request #707 from mattmoyer/fix-okta-cli-integration-test

Fix TestCLILoginOIDC when running against Okta, and lower CLI server shutdown timeout.
This commit is contained in:
Matt Moyer 2021-07-09 14:30:19 -07:00 committed by GitHub
commit c71703e4db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -850,9 +850,9 @@ func (h *handlerState) serve(listener net.Listener) func() {
} }
go func() { _ = srv.Serve(listener) }() go func() { _ = srv.Serve(listener) }()
return func() { return func() {
// Gracefully shut down the server, allowing up to 5 seconds for // Gracefully shut down the server, allowing up to 5 00ms for
// clients to receive any in-flight responses. // clients to receive any in-flight responses.
shutdownCtx, cancel := context.WithTimeout(h.ctx, 5*time.Second) shutdownCtx, cancel := context.WithTimeout(h.ctx, 500*time.Millisecond)
_ = srv.Shutdown(shutdownCtx) _ = srv.Shutdown(shutdownCtx)
cancel() cancel()
} }

View File

@ -355,7 +355,7 @@ func runPinnipedLoginOIDC(
// Expect to be redirected to the localhost callback. // Expect to be redirected to the localhost callback.
t.Logf("waiting for redirect to callback") t.Logf("waiting for redirect to callback")
callbackURLPattern := regexp.MustCompile(`\A` + regexp.QuoteMeta(env.CLIUpstreamOIDC.CallbackURL) + `\?.+\z`) callbackURLPattern := regexp.MustCompile(`\A` + regexp.QuoteMeta(env.CLIUpstreamOIDC.CallbackURL) + `(\?.+)?\z`)
browsertest.WaitForURL(t, page, callbackURLPattern) browsertest.WaitForURL(t, page, callbackURLPattern)
// Wait for the "pre" element that gets rendered for a `text/plain` page, and // Wait for the "pre" element that gets rendered for a `text/plain` page, and