weaveworks / weave-gitops-enterprise

This repo provides the enterprise level features for the weave-gitops product, including CAPI cluster creation and team workspaces.
https://docs.gitops.weave.works/
Apache License 2.0
160 stars 29 forks source link

followup on causes for the panic in the collector for TestWatch #2656

Open enekofb opened 1 year ago

enekofb commented 1 year ago

TestWatch paniced in CI

=== RUN   TestWatch/can_watch_cluster
=== NAME  TestWatch
    watching_test.go:243: "level"=0 "msg"="created fake watcher"
--- PASS: TestWatch (0.00s)
    --- PASS: TestWatch/can_watch_cluster (0.00s)
=== RUN   TestStatusCluster
    watching_test.go:169: "level"=0 "msg"="fake cluster created" "cluster"="test"
    watching_test.go:243: "level"=0 "msg"="created fake watcher"
=== RUN   TestStatusCluster/cannot_get_status_for_cluster_without_name
=== NAME  TestStatusCluster
    watching_test.go:169: "level"=0 "msg"="fake cluster created" "cluster"=""
=== RUN   TestStatusCluster/could_get_status_for_existing_cluster
=== NAME  TestStatusCluster
    watching_test.go:169: "level"=0 "msg"="fake cluster created" "cluster"="test"
    watching_test.go:267: "level"=0 "msg"="fake watcher status"
=== RUN   TestStatusCluster/could_not_get_status_for_non_existing_clusterName
=== NAME  TestStatusCluster
    watching_test.go:169: "level"=0 "msg"="fake cluster created" "cluster"="dontexist"
--- PASS: TestStatusCluster (0.00s)
    --- PASS: TestStatusCluster/cannot_get_status_for_cluster_without_name (0.00s)
    --- PASS: TestStatusCluster/could_get_status_for_existing_cluster (0.00s)
    --- PASS: TestStatusCluster/could_not_get_status_for_non_existing_clusterName (0.00s)
PASS
panic: Log in goroutine after TestWatch has completed: "level"=0 "msg"="fake watcher started"

goroutine 63 [running]:
testing.(*common).logDepth(0xc0004f3380, {0xc00021e240, 0x27}, 0x3)
    /opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:1003 +0x4e7
testing.(*common).log(...)
    /opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:985
testing.(*common).Log(0xc0004f3380, {0xc0005b5cd8?, 0x0?, 0x0?})
    /opt/hostedtoolcache/go/1.20.2/x64/src/testing/testing.go:1026 +0x4e
github.com/go-logr/logr/testr.testlogger.Info({{0x0, {0x1f36090, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, 0x1, {0x0, ...}}, ...}, ...)
    /home/runner/go/pkg/mod/github.com/go-logr/logr@v1.2.3/testr/testr.go:95 +0x18e
github.com/go-logr/logr.Logger.Info({{0x1f559e0?, 0xc0001390e0?}, 0x39?}, {0x1ce2f71, 0x14}, {0x0, 0x0, 0x0})
    /home/runner/go/pkg/mod/github.com/go-logr/logr@v1.2.3/logr.go:261 +0xd0
github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector.fakeWatcher.Start(...)
    /home/runner/work/weave-gitops-enterprise/weave-gitops-enterprise/pkg/query/collector/watching_test.go:257
github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector.(*watchingCollector).Watch.func1()
    /home/runner/work/weave-gitops-enterprise/weave-gitops-enterprise/pkg/query/collector/watching.go:154 +0x83
created by github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector.(*watchingCollector).Watch
    /home/runner/work/weave-gitops-enterprise/weave-gitops-enterprise/pkg/query/collector/watching.go:153 +0x44f
FAIL    github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector   0.032s

We removed it to dont block the release but

AC

This ticket is to followup not in the test itself but to understand whether

enekofb commented 1 year ago

happened also

panic: Log in goroutine after TestWatcher_Stop has completed: "level"=0 "msg"="faked"

goroutine 22 [running]:
testing.(*common).logDepth(0xc000140b60, {0xc0003cc798, 0x18}, 0x3)
    /opt/hostedtoolcache/go/1.20.3/x64/src/testing/testing.go:1003 +0x4e7
testing.(*common).log(...)
    /opt/hostedtoolcache/go/1.20.3/x64/src/testing/testing.go:985
testing.(*common).Log(0xc000140b60, {0xc00052fd18?, 0x0?, 0x0?})
    /opt/hostedtoolcache/go/1.20.3/x64/src/testing/testing.go:1026 +0x4e
github.com/go-logr/logr/testr.testlogger.Info({{0x0, {0x1f3dad0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, 0x1, {0x0, ...}}, ...}, ...)
    /home/runner/go/pkg/mod/github.com/go-logr/logr@v1.2.3/testr/testr.go:95 +0x18e
github.com/go-logr/logr.Logger.Info({{0x1f5d540?, 0xc0000d60a0?}, 0x570a74?}, {0x1cd44fb, 0x5}, {0x0, 0x0, 0x0})
    /home/runner/go/pkg/mod/github.com/go-logr/logr@v1.2.3/logr.go:261 +0xd0
github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector/kubefakes.fakeControllerManager.Start(...)
    /home/runner/work/weave-gitops-enterprise/weave-gitops-enterprise/pkg/query/collector/kubefakes/manager.go:72
github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector.(*DefaultWatcher).Start.func1()
    /home/runner/work/weave-gitops-enterprise/weave-gitops-enterprise/pkg/query/collector/watcher.go:196 +0x44
created by github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector.(*DefaultWatcher).Start
    /home/runner/work/weave-gitops-enterprise/weave-gitops-enterprise/pkg/query/collector/watcher.go:195 +0x32a
FAIL    github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector   0.043s
?       github.com/weaveworks/weave-gitops-enterprise/pkg/query/collector/reconciler/reconcilerfakes    [no test files]
?       github.com/weaveworks/weave-gitops-enterprise/pkg/query/configuration   [no test files]
=== RUN   TestNewReconciler
jpellizzari commented 1 year ago

Validate that this has been fixed.

LappleApple commented 1 year ago

Did we resolve?

enekofb commented 1 year ago

needs to be validated, is in teams' next column