Skip to content

Commit

Permalink
fix: fix incomplete cleanup in tunnel.json and zombie process in func…
Browse files Browse the repository at this point in the history
…tional test
  • Loading branch information
ComradeProgrammer committed Jun 30, 2024
1 parent 981083d commit 7070dbd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion pkg/minikube/tunnel/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ func (r *persistentRegistry) Register(tunnel *ID) (rerr error) {

alreadyExists := false
for i, t := range tunnels {
if t.Route.Equal(tunnel.Route) {
// it is allowed for multiple minikube clusters to have multiple tunnels simultaneously
// it is possible that an old tunnel from an old profile has duplicated route information
// so we need to check both machine name and route information
if tunnel.MachineName == t.MachineName && t.Route.Equal(tunnel.Route) {
isRunning, err := checkIfRunning(t.Pid)
if err != nil {
return fmt.Errorf("error checking whether conflicting tunnel (%v) is running: %s", t, err)
Expand Down
2 changes: 1 addition & 1 deletion site/themes/docsy
Submodule docsy updated 75 files
+4 −1 .markdown-link-check.json
+1 −1 .vscode/cspell.json
+30 −4 CHANGELOG.md
+3 −3 CONTRIBUTING.md
+23 −29 assets/_vendor/bootstrap/scss/_rfs.scss
+0 −1 assets/js/click-to-copy.js
+87 −0 assets/js/dark-mode.js
+1 −1 assets/js/offline-search.js
+0 −1 assets/scss/_alerts.scss
+18 −0 assets/scss/_boxes.scss
+17 −12 assets/scss/_code.scss
+2 −2 assets/scss/_content.scss
+21 −5 assets/scss/_nav.scss
+5 −6 assets/scss/_pageinfo.scss
+4 −4 assets/scss/_search.scss
+2 −2 assets/scss/_sidebar-toc.scss
+8 −9 assets/scss/_sidebar-tree.scss
+8 −8 assets/scss/_taxonomy.scss
+5 −10 assets/scss/_variables.scss
+2 −5 assets/scss/_variables_project.scss
+4 −0 assets/scss/_variables_project_after_bs.scss
+3 −1 assets/scss/main.scss
+2 −2 assets/scss/rtl/_main.scss
+5 −1 assets/scss/shortcodes/cards-pane.scss
+5 −5 assets/scss/shortcodes/tabbed-pane.scss
+10 −0 assets/scss/td/_code-dark.scss
+87 −0 assets/scss/td/chroma/_dark.scss
+87 −0 assets/scss/td/chroma/_light.scss
+2 −2 go.mod
+4 −4 go.sum
+10 −0 i18n/es.toml
+1 −1 layouts/_default/content.html
+0 −43 layouts/_default/list.rss.xml
+3 −3 layouts/_internal/google_analytics_gtag.html
+2 −2 layouts/blog/content.html
+1 −1 layouts/blog/list.html
+1 −1 layouts/docs/list.html
+1 −1 layouts/partials/disqus-comment.html
+1 −1 layouts/partials/featured-image.html
+2 −1 layouts/partials/footer/copyright.html
+6 −6 layouts/partials/head.html
+7 −2 layouts/partials/navbar.html
+1 −1 layouts/partials/print/content-blog.html
+13 −9 layouts/partials/scripts.html
+42 −19 layouts/partials/scripts/mermaid.html
+6 −5 layouts/partials/section-index.html
+59 −0 layouts/partials/theme-toggler.html
+0 −16 layouts/shortcodes/card-code.html
+2 −2 layouts/shortcodes/card.html
+1 −1 layouts/shortcodes/imgproc.html
+1 −1 layouts/swagger/list.html
+14 −16 package.json
+71 −0 tools/gen-chroma-styles.sh
+1 −1 tools/getHugoModules/index.mjs
+7 −3 tools/install-hugo.sh
+15 −0 userguide/.prettierignore
+1 −0 userguide/assets/scss/_styles_project.scss
+1 −1 userguide/content/en/blog/2023/bootstrap-5-migration.md
+1 −1 userguide/content/en/blog/2023/docsy-0.7.md
+1 −1 userguide/content/en/blog/2023/priorities-for-2024.md
+108 −0 userguide/content/en/blog/2024/0.10.0.md
+7 −7 userguide/content/en/blog/2024/0.9.0.md
+57 −22 userguide/content/en/docs/_index.md
+4 −4 userguide/content/en/docs/adding-content/diagrams-and-formulae/index.md
+9 −5 userguide/content/en/docs/adding-content/feedback.md
+293 −123 userguide/content/en/docs/adding-content/lookandfeel.md
+2 −2 userguide/content/en/docs/adding-content/shortcodes/index.md
+37 −5 userguide/content/en/docs/contribution-guidelines/_index.md
+1 −0 userguide/content/en/docs/examples/_index.md
+1 −1 userguide/content/en/docs/get-started/_index.md
+2 −2 userguide/content/en/docs/get-started/docsy-as-module/start-from-scratch.md
+13 −10 userguide/content/en/docs/get-started/other-options.md
+7 −6 userguide/hugo.yaml
+0 −22 userguide/layouts/sitemap.xml
+4 −1 userguide/package.json
4 changes: 2 additions & 2 deletions test/integration/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestFunctional(t *testing.T) {

// TestFunctionalNewestKubernetes are functionality run functional tests using NewestKubernetesVersion
func TestFunctionalNewestKubernetes(t *testing.T) {
if strings.Contains(*startArgs, "--kubernetes-version") {
if strings.Contains(*startArgs, "--kubernetes-version") || constants.NewestKubernetesVersion == constants.DefaultKubernetesVersion {
t.Skip()
}
k8sVersionString := constants.NewestKubernetesVersion
Expand All @@ -90,7 +90,7 @@ func TestFunctionalNewestKubernetes(t *testing.T) {

func testFunctional(t *testing.T, k8sVersion string) {
profile := UniqueProfileName("functional")
ctx := context.WithValue(context.Background(), "k8sVersion", k8sVersion)
ctx := context.WithValue(context.Background(), ContextKey("k8sVersion"), k8sVersion)
ctx, cancel := context.WithTimeout(ctx, Minutes(40))
defer func() {
if !*cleanup {
Expand Down
5 changes: 5 additions & 0 deletions test/integration/functional_test_tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,9 @@ func validateTunnelDelete(_ context.Context, t *testing.T, _ string) {
checkRoutePassword(t)
// Stop tunnel
tunnelSession.Stop(t)
// prevent the child process from becoming a defunct zombie process
if err := tunnelSession.cmd.Wait(); err != nil {
t.Logf("failed to stop process: %v", err)
return
}
}
4 changes: 3 additions & 1 deletion test/integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ func StartArgs() []string {
return strings.Split(*startArgs, " ")
}

type ContextKey string

func StartArgsWithContext(ctx context.Context) []string {
res := strings.Split(*startArgs, " ")
value := ctx.Value("k8sVersion")
value := ctx.Value(ContextKey("k8sVersion"))
if value != nil && value != "" {
res = append(res, fmt.Sprintf("--kubernetes-version=%s", value))
}
Expand Down

0 comments on commit 7070dbd

Please sign in to comment.