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

data races detected #109

Open
imjasonh opened this issue Jun 25, 2023 · 0 comments
Open

data races detected #109

imjasonh opened this issue Jun 25, 2023 · 0 comments

Comments

@imjasonh
Copy link
Member

TF_ACC=1 go test ./internal/provider/... -count=1 -race
==================
--- FAIL: TestAccResourceApkoBuild (29.35s)
    testing.go:1446: race detected during execution of test
==================
WARNING: DATA RACE
Write at 0x00c000450130 by goroutine 164:
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.fromImageData()
      /Users/jason/git/terraform-provider-apko/internal/provider/build.go:37 +0x4ac
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.(*ConfigDataSource).resolvePackageList.func1()
      /Users/jason/git/terraform-provider-apko/internal/provider/config_data_source.go:186 +0x34c
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /Users/jason/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x6c

Previous read at 0x00c000450130 by goroutine 162:
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.(*ConfigDataSource).resolvePackageList()
      /Users/jason/git/terraform-provider-apko/internal/provider/config_data_source.go:183 +0x30c
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.(*ConfigDataSource).Read()
      /Users/jason/git/terraform-provider-apko/internal/provider/config_data_source.go:153 +0x1770
  github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ReadDataSource()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.3.1/internal/fwserver/server_readdatasource.go:79 +0x584
  github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ReadDataSource()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.3.1/internal/proto6server/server_readdatasource.go:55 +0x408
  github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadDataSource()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov6/tf6server/server.go:659 +0x5b4
  github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadDataSource_Handler()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:458 +0x1f4
  google.golang.org/grpc.(*Server).processUnaryRPC()
      /Users/jason/go/pkg/mod/google.golang.org/grpc@v1.56.0/server.go:1337 +0x11f4
  google.golang.org/grpc.(*Server).handleStream()
      /Users/jason/go/pkg/mod/google.golang.org/grpc@v1.56.0/server.go:1714 +0xbf4
  google.golang.org/grpc.(*Server).serveStreams.func1.1()
      /Users/jason/go/pkg/mod/google.golang.org/grpc@v1.56.0/server.go:959 +0xa4
==================
--- FAIL: TestAccDataSourceConfig_ExtraPackages (7.65s)
    testing.go:1446: race detected during execution of test
==================
WARNING: DATA RACE
Read at 0x00c000428940 by goroutine 3528:
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.doBuild.func1()
      /Users/jason/git/terraform-provider-apko/internal/provider/build.go:130 +0x624
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /Users/jason/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x6c

Previous write at 0x00c000428940 by goroutine 3527:
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.doBuild.func1()
      /Users/jason/git/terraform-provider-apko/internal/provider/build.go:131 +0x67c
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /Users/jason/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x6c

Goroutine 3528 (running) created at:
  golang.org/x/sync/errgroup.(*Group).Go()
      /Users/jason/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:72 +0x10c
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.doBuild()
      /Users/jason/git/terraform-provider-apko/internal/provider/build.go:105 +0x6d4
  github.com/chainguard-dev/terraform-provider-apko/internal/provider.(*BuildResource).Create()
      /Users/jason/git/terraform-provider-apko/internal/provider/resource_build.go:157 +0x3e0
  github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).CreateResource()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.3.1/internal/fwserver/server_createresource.go:101 +0x5a0
  github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.3.1/internal/fwserver/server_applyresourcechange.go:57 +0x178
  github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-framework@v1.3.1/internal/proto6server/server_applyresourcechange.go:55 +0x3fc
  github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov6/tf6server/server.go:819 +0x4d4
  github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler()
      /Users/jason/go/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.16.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:422 +0x1f4
  google.golang.org/grpc.(*Server).processUnaryRPC()
      /Users/jason/go/pkg/mod/google.golang.org/grpc@v1.56.0/server.go:1337 +0x11f4
  google.golang.org/grpc.(*Server).handleStream()
      /Users/jason/go/pkg/mod/google.golang.org/grpc@v1.56.0/server.go:1714 +0xbf4
  google.golang.org/grpc.(*Server).serveStreams.func1.1()
      /Users/jason/go/pkg/mod/google.golang.org/grpc@v1.56.0/server.go:959 +0xa4
==================
--- FAIL: TestAccDataSourceConfig (3.69s)
    testing.go:1446: race detected during execution of test
==================
WARNING: DATA RACE
Write at 0x00c0006903a0 by goroutine 1060:
  github.com/chainguard-dev/go-apk/pkg/fs.newMemFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:545 +0x650
  github.com/chainguard-dev/go-apk/pkg/fs.(*memFS).openFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:271 +0x680
  github.com/chainguard-dev/go-apk/pkg/fs.(*memFS).OpenFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:220 +0x60
  github.com/chainguard-dev/go-apk/pkg/fs.(*memFS).WriteFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:288 +0x44
  github.com/chainguard-dev/go-apk/pkg/fs.(*dirFS).WriteFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/rwosfs.go:428 +0x11c
  github.com/chainguard-dev/go-apk/pkg/apk.(*APK).InitKeyring.func1()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/apk/implementation.go:389 +0x648
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /Users/jason/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x6c

Previous write at 0x00c0006903a0 by goroutine 1059:
  github.com/chainguard-dev/go-apk/pkg/fs.newMemFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:545 +0x650
  github.com/chainguard-dev/go-apk/pkg/fs.(*memFS).openFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:271 +0x680
  github.com/chainguard-dev/go-apk/pkg/fs.(*memFS).OpenFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:220 +0x60
  github.com/chainguard-dev/go-apk/pkg/fs.(*memFS).WriteFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/memfs.go:288 +0x44
  github.com/chainguard-dev/go-apk/pkg/fs.(*dirFS).WriteFile()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/fs/rwosfs.go:428 +0x11c
  github.com/chainguard-dev/go-apk/pkg/apk.(*APK).InitKeyring.func1()
      /Users/jason/go/pkg/mod/github.com/chainguard-dev/go-apk@v0.0.0-20230623221358-f867b780f14b/pkg/apk/implementation.go:389 +0x648
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /Users/jason/go/pkg/mod/golang.org/x/sync@v0.3.0/errgroup/errgroup.go:75 +0x6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant