pulumi/pkg/codegen/schema
Fraser Waters f8e821c861
Fix a datarace (#15233)
Seen while running tests for another PR:
https://github.com/pulumi/pulumi/actions/runs/7639934341/job/20814238592?pr=15232

```
WARNING: DATA RACE
Read at 0x00c0009e8480 by goroutine 46:
  github.com/pulumi/pulumi/pkg/v3/codegen/schema.(*Package).TokenToModule()
      /home/runner/work/pulumi/pulumi/pkg/codegen/schema/schema.go:873 +0x13e
  github.com/pulumi/pulumi/pkg/v3/codegen/schema.packageDefRef.TokenToModule()
      /home/runner/work/pulumi/pulumi/pkg/codegen/schema/package_reference.go:171 +0x84
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.canonicalizeToken()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_schema.go:181 +0x10d
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*packageSchema).initResourceMap()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_schema.go:111 +0x124
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*packageSchema).LookupResource()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_schema.go:84 +0xf7
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*binder).bindResourceTypes()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_resource.go:197 +0xeb8
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*binder).bindResource()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_resource.go:37 +0x79
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*binder).bindNode()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_nodes.go:62 +0x819
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.BindProgram()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder.go:219 +0x1a31
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.TestBindResourceOptions.func1()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_resource_test.go:104 +0x6f8
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.5/x64/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.21.5/x64/src/testing/testing.go:1648 +0x44

Previous write at 0x00c0009e8480 by goroutine 42:
  github.com/pulumi/pulumi/pkg/v3/codegen/schema.(*Package).TokenToModule()
      /home/runner/work/pulumi/pulumi/pkg/codegen/schema/schema.go:874 +0x17c
  github.com/pulumi/pulumi/pkg/v3/codegen/schema.packageDefRef.TokenToModule()
      /home/runner/work/pulumi/pulumi/pkg/codegen/schema/package_reference.go:171 +0x84
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.canonicalizeToken()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_schema.go:181 +0x10d
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*packageSchema).initResourceMap()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_schema.go:111 +0x124
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*packageSchema).LookupResource()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_schema.go:84 +0xf7
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*binder).bindResourceTypes()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_resource.go:197 +0xeb8
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*binder).bindResource()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_resource.go:37 +0x79
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.(*binder).bindNode()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_nodes.go:62 +0x819
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.BindProgram()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder.go:219 +0x1a31
  github.com/pulumi/pulumi/pkg/v3/codegen/pcl.TestBindResourceOptions.func1()
      /home/runner/work/pulumi/pulumi/pkg/codegen/pcl/binder_resource_test.go:104 +0x6f8
  testing.tRunner()
      /opt/hostedtoolcache/go/1.21.5/x64/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.21.5/x64/src/testing/testing.go:1648 +0x44
```
2024-01-24 15:33:42 +00:00
..
bind.go [schema] Emit a warning when using id or urn as resource properties (#15060) 2024-01-18 00:35:51 +00:00
docs_parser.go golangci-lint: Enable staticcheck 2023-01-14 16:59:46 -08:00
docs_renderer.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
docs_test.go Actually disable plugin acquisition (#14134) 2023-10-14 08:32:43 +00:00
loader.go Add an envar to disable automatic provider installation (#14083) 2023-10-03 15:35:23 +00:00
loader_client.go Add matrix testing (#13705) 2023-09-13 15:17:46 +00:00
loader_schema_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
loader_server.go Add schema loader service 2023-07-27 15:03:52 +01:00
loader_test.go all: Don't use cmdutil.Diag in tests 2023-03-13 12:54:04 -07:00
mock_pulumi_schema.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00
package_reference.go Use slice.Prealloc instead of make([]T, 0, ...) 2023-06-29 11:27:50 +01:00
pulumi.json Don't set additionalProperties 2023-03-27 10:11:57 +01:00
schema.go Fix a datarace (#15233) 2024-01-24 15:33:42 +00:00
schema_test.go [schema] Emit a warning when using id or urn as resource properties (#15060) 2024-01-18 00:35:51 +00:00