Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in test #21476

Open
crenshaw-dev opened this issue Jan 13, 2025 · 1 comment
Open

Race condition in test #21476

crenshaw-dev opened this issue Jan 13, 2025 · 1 comment
Labels
bug Something isn't working component:server component:test Test requests (e2e or unit)

Comments

@crenshaw-dev
Copy link
Member

At a glance, looks like the race is isolated to a test.

=== Failed
=== FAIL: server/application TestRunNewStyleResourceAction/CreateOperationNotPermitted (0.62s)
time="2025-01-10T21:23:51Z" level=info msg="Starting configmap/secret informers"
time="2025-01-10T21:23:51Z" level=info msg="Configmap/secret informer synced"
time="2025-01-10T21:23:51Z" level=info msg="Starting configmap/secret informers"
time="2025-01-10T21:23:51Z" level=info msg="configmap informer cancelled"
time="2025-01-10T21:23:51Z" level=info msg="secrets informer cancelled"
time="2025-01-10T21:23:51Z" level=info msg="Configmap/secret informer synced"
time="2025-01-10T21:23:51Z" level=info msg="Starting configmap/secret informers"
time="2025-01-10T21:23:51Z" level=info msg="secrets informer cancelled"
time="2025-01-10T21:23:51Z" level=info msg="configmap informer cancelled"
time="2025-01-10T21:23:51Z" level=info msg="Configmap/secret informer synced"
time="2025-01-10T21:23:51Z" level=info msg="Starting configmap/secret informers"
time="2025-01-10T21:23:52Z" level=info msg="Configmap/secret informer synced"
==================
WARNING: DATA RACE
Write at 0x00c005b32938 by goroutine 3864:
  github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1.(*ApplicationDestination).SetInferredName()
      /home/runner/work/argo-cd/argo-cd/pkg/apis/application/v1alpha1/types.go:3280 +0x584
  github.com/argoproj/argo-cd/v2/util/argo.ValidateDestination()
      /home/runner/work/argo-cd/argo-cd/util/argo/argo.go:521 +0x55f
  github.com/argoproj/argo-cd/v2/server/application.(*Server).getApplicationClusterConfig()
      /home/runner/work/argo-cd/argo-cd/server/application/application.go:1289 +0xfc
  github.com/argoproj/argo-cd/v2/server/application.(*Server).getAppLiveResource()
      /home/runner/work/argo-cd/argo-cd/server/application/application.go:1355 +0x1784
  github.com/argoproj/argo-cd/v2/server/application.(*Server).getUnstructuredLiveResourceOrApp()
      /home/runner/work/argo-cd/argo-cd/server/application/application.go:2370 +0xb24
  github.com/argoproj/argo-cd/v2/server/application.(*Server).RunResourceAction()
      /home/runner/work/argo-cd/argo-cd/server/application/application.go:2413 +0x684
  github.com/argoproj/argo-cd/v2/server/application.TestRunNewStyleResourceAction.func1()
      /home/runner/work/argo-cd/argo-cd/server/application/application_test.go:2493 +0x717
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.10/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.10/x64/src/testing/testing.go:1742 +0x44

Previous read at 0x00c005b32938 by goroutine 3952:
  github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1.(*ApplicationDestination).String()
      /home/runner/work/argo-cd/argo-cd/pkg/apis/application/v1alpha1/generated.pb.go:18636 +0x184
  github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1.(*ApplicationSpec).String()
      /home/runner/work/argo-cd/argo-cd/pkg/apis/application/v1alpha1/generated.pb.go:19181 +0x572
  github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1.(*Application).String()
      /home/runner/work/argo-cd/argo-cd/pkg/apis/application/v1alpha1/generated.pb.go:18610 +0x11a
  github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1.(*Application).String()
      /home/runner/work/argo-cd/argo-cd/pkg/apis/application/v1alpha1/generated.pb.go:18609 +0xb9
  fmt.(*pp).handleMethods()
      /opt/hostedtoolcache/go/1.22.10/x64/src/fmt/print.go:673 +0x6ea
  fmt.(*pp).printArg()
      /opt/hostedtoolcache/go/1.22.10/x64/src/fmt/print.go:756 +0xb4b
  fmt.(*pp).doPrintf()
      /opt/hostedtoolcache/go/1.22.10/x64/src/fmt/print.go:1174 +0x10ce
  fmt.Sprintf()
      /opt/hostedtoolcache/go/1.22.10/x64/src/fmt/print.go:239 +0x5c
  github.com/stretchr/testify/mock.Arguments.Diff()
      /home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:965 +0x1ac
  github.com/stretchr/testify/mock.(*Mock).findExpectedCall()
      /home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:383 +0x147
  github.com/stretchr/testify/mock.(*Mock).MethodCalled()
      /home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:491 +0xac
  github.com/stretchr/testify/mock.(*Mock).Called()
      /home/runner/go/pkg/mod/github.com/stretchr/[email protected]/mock/mock.go:481 +0x195
  github.com/argoproj/argo-cd/v2/server/application/mocks.(*Broadcaster).OnAdd()
      /home/runner/work/argo-cd/argo-cd/server/application/mocks/Broadcaster.go:17 +0x136
  k8s.io/client-go/tools/cache.(*processorListener).run.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:978 +0x287
  k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:226 +0x41
  k8s.io/apimachinery/pkg/util/wait.BackoffUntil()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:227 +0xc4
  k8s.io/apimachinery/pkg/util/wait.JitterUntil()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:204 +0x10a
  k8s.io/apimachinery/pkg/util/wait.Until()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:161 +0x9b
  k8s.io/client-go/tools/cache.(*processorListener).run()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:972 +0x38
  k8s.io/client-go/tools/cache.(*processorListener).run-fm()
      <autogenerated>:1 +0x33
  k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:72 +0x86

Goroutine 3864 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.22.10/x64/src/testing/testing.go:1742 +0x825
  github.com/argoproj/argo-cd/v2/server/application.TestRunNewStyleResourceAction()
      /home/runner/work/argo-cd/argo-cd/server/application/application_test.go:2481 +0x118f
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.10/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.22.10/x64/src/testing/testing.go:1742 +0x44

Goroutine 3952 (running) created at:
  k8s.io/apimachinery/pkg/util/wait.(*Group).Start()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:70 +0xe4
  k8s.io/client-go/tools/cache.(*sharedProcessor).addListener()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:748 +0x227
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).AddEventHandlerWithResyncPeriod()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:623 +0x770
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).AddEventHandler()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:561 +0x51
  github.com/argoproj/argo-cd/v2/server/application.NewServer()
      /home/runner/work/argo-cd/argo-cd/server/application/application.go:120 +0x1a5
  github.com/argoproj/argo-cd/v2/server/application.newTestAppServerWithEnforcerConfigure()
      /home/runner/work/argo-cd/argo-cd/server/application/application_test.go:295 +0x2b51
  github.com/argoproj/argo-cd/v2/server/application.newTestAppServer()
      /home/runner/work/argo-cd/argo-cd/server/application/application_test.go:138 +0x53
  github.com/argoproj/argo-cd/v2/server/application.TestRunNewStyleResourceAction.func1()
      /home/runner/work/argo-cd/argo-cd/server/application/application_test.go:2487 +0x364
  testing.tRunner()
      /opt/hostedtoolcache/go/1.22.10/x64/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()

@crenshaw-dev crenshaw-dev added the bug Something isn't working label Jan 13, 2025
@agaudreault agaudreault added component:test Test requests (e2e or unit) component:server labels Jan 15, 2025
@reggie-k
Copy link
Member

Seems resolved by #21271
Does this still reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component:server component:test Test requests (e2e or unit)
Projects
None yet
Development

No branches or pull requests

3 participants