Skip to content

DATA RACE: TestProcessHTTPRoutesWithCustomBackends #7816

Closed

Description

@zirain
WARNING: DATA RACE
Write at 0x00c000ef4f00 by goroutine 3401:
  runtime.mapassign()
      /opt/hostedtoolcache/go/1.25.5/x64/src/internal/runtime/maps/runtime_swiss.go:188 +0x0
  k8s.io/apimachinery/pkg/runtime.(*Scheme).AddKnownTypeWithName()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/scheme.go:192 +0x4fa
  sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeClient).addToSchemeIfUnknownAndUnstructuredOrPartial()
      /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/client/fake/client.go:1887 +0x2c9
  sigs.k8s.io/controller-runtime/pkg/client/fake.(*fakeClient).List()
      /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/client/fake/client.go:683 +0x95
  github.com/envoyproxy/gateway/internal/provider/kubernetes.(*gatewayAPIReconciler).getExtensionBackendResources()
      /home/runner/work/gateway/gateway/internal/provider/kubernetes/filters.go:59 +0x2e1
  github.com/envoyproxy/gateway/internal/provider/kubernetes.(*gatewayAPIReconciler).processHTTPRoutes()
      /home/runner/work/gateway/gateway/internal/provider/kubernetes/routes.go:216 +0x3d6
  github.com/envoyproxy/gateway/internal/provider/kubernetes.TestProcessHTTPRoutesWithCustomBackends.func1()
      /home/runner/work/gateway/gateway/internal/provider/kubernetes/routes_test.go:1300 +0x971
  testing.tRunner()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1934 +0x21c
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x44

Previous read at 0x00c000ef4f00 by goroutine 1724:
  runtime.mapaccess1()
      /opt/hostedtoolcache/go/1.25.5/x64/src/internal/runtime/maps/runtime_swiss.go:40 +0x0
  k8s.io/apimachinery/pkg/runtime.(*Scheme).ObjectKinds()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/scheme.go:274 +0x149
  k8s.io/apimachinery/pkg/runtime.(*parameterCodec).EncodeParameters()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/runtime/codec.go:190 +0x95
  k8s.io/client-go/rest.(*Request).SpecificallyVersionedParams()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/rest/request.go:439 +0xee
  k8s.io/client-go/rest.(*Request).VersionedParams()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/rest/request.go:432 +0x23d
  sigs.k8s.io/controller-runtime/pkg/cache/internal.(*Informers).makeListWatcher.func6()
      /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/internal/informers.go:551 +0x162
  sigs.k8s.io/controller-runtime/pkg/cache/internal.(*Informers).addInformerToMap.func2()
      /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/internal/informers.go:377 +0x144
  k8s.io/client-go/tools/cache.(*ListWatch).WatchWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/listwatch.go:309 +0xe6
  k8s.io/client-go/tools/cache.(*Reflector).watchList()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:771 +0x8cb
  k8s.io/client-go/tools/cache.(*Reflector).ListAndWatchWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:423 +0x354
  k8s.io/client-go/tools/cache.(*Reflector).RunWithContext.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:369 +0x4a
  k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:233 +0x2e
  k8s.io/apimachinery/pkg/util/wait.BackoffUntilWithContext.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:255 +0x98
  k8s.io/apimachinery/pkg/util/wait.BackoffUntilWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:256 +0xed
  k8s.io/apimachinery/pkg/util/wait.BackoffUntil()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/backoff.go:233 +0x8a
  k8s.io/client-go/tools/cache.(*Reflector).RunWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:368 +0x3e4
  k8s.io/client-go/tools/cache.(*Reflector).RunWithContext-fm()
      <autogenerated>:1 +0x47
  k8s.io/client-go/tools/cache.(*controller).RunWithContext.(*Group).StartWithContext.func3()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:63 +0x46
  k8s.io/apimachinery/pkg/util/wait.(*Group).Start.func1()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:72 +0x82

Goroutine 3401 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x9d2
  github.com/envoyproxy/gateway/internal/provider/kubernetes.TestProcessHTTPRoutesWithCustomBackends()
      /home/runner/work/gateway/gateway/internal/provider/kubernetes/routes_test.go:1279 +0x195e
  testing.tRunner()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1934 +0x21c
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x44

Goroutine 1724 (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 +0xdc
  k8s.io/apimachinery/pkg/util/wait.(*Group).StartWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/pkg/util/wait/wait.go:62 +0x7de
  k8s.io/client-go/tools/cache.(*controller).RunWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/controller.go:197 +0x69c
  k8s.io/client-go/tools/cache.(*sharedIndexInformer).RunWithContext()
      /home/runner/go/pkg/mod/k8s.io/[email protected]/tools/cache/shared_informer.go:579 +0x685
  sigs.k8s.io/controller-runtime/pkg/cache/internal.(*Cache).Start()
      /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/internal/informers.go:114 +0x17e
  sigs.k8s.io/controller-runtime/pkg/cache/internal.(*Informers).startInformerLocked.func1()
      /home/runner/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/cache/internal/informers.go:248 +0xba
==================
2025-12-25T01:37:43.158Z	INFO	kubernetes/routes.go:249	processing HTTPRoute	{"namespace": "default", "name": "test-route"}
2025-12-25T01:37:43.168Z	INFO	kubernetes/routes.go:249	processing HTTPRoute	{"namespace": "default", "name": "test-route"}
2025-12-25T01:37:43.168Z	ERROR	kubernetes/routes.go:257	invalid backendRef	{"error": "invalid group; must be nil, empty string \"multicluster.x-k8s.io\" or \"gateway.envoyproxy.io\""}
--- FAIL: TestProcessHTTPRoutesWithCustomBackends (0.03s)
    --- FAIL: TestProcessHTTPRoutesWithCustomBackends/custom_backend_GVKs_configured_with_matching_resources (0.01s)
        testing.go:1617: race detected during execution of test




FAIL
coverage: 9.7% of statements in ./...

https://github.com/envoyproxy/gateway/actions/runs/20496528964/job/58897731850

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions