vulpemventures / ocean

:ocean: Elements/Liquid wallet daemon
MIT License
5 stars 7 forks source link

Race conditions when testing #15

Open altafan opened 1 year ago

altafan commented 1 year ago

Sometimes seems like tests generate race conditions. Further info will follow.

sekulicd commented 1 year ago
WARNING: DATA RACE
Read at 0x00c020beed43 by goroutine 654:
  testing.(*common).logDepth()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:883 +0xc4
  testing.(*common).log()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:876 +0xa4
  testing.(*common).Logf()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:927 +0x6a
  github.com/equitas-foundation/bamp-ocean/internal/infrastructure/storage/db/test_test.TestWalletRepository.func1.1()
      /home/runner/work/ocean/ocean/internal/infrastructure/storage/db/test/wallet_repository_test.go:69 +0x1fd
  github.com/equitas-foundation/bamp-ocean/internal/infrastructure/storage/db/inmemory.(*repoManager).listenToWalletEvents.func1()
      /home/runner/work/ocean/ocean/internal/infrastructure/storage/db/inmemory/repo_manager.go:79 +0xb2

Previous write at 0x00c020beed43 by goroutine 541:
  testing.tRunner.func1()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1433 +0x7e4
  runtime.deferreturn()
      /opt/hostedtoolcache/go/1.19.4/x64/src/runtime/panic.go:476 +0x32
  testing.(*T).Run.func1()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1493 +0x47

Goroutine 654 (running) created at:
  github.com/equitas-foundation/bamp-ocean/internal/infrastructure/storage/db/inmemory.(*repoManager).listenToWalletEvents()
      /home/runner/work/ocean/ocean/internal/infrastructure/storage/db/inmemory/repo_manager.go:79 +0x190
  github.com/equitas-foundation/bamp-ocean/internal/infrastructure/storage/db/inmemory.NewRepoManager.func1()
      /home/runner/work/ocean/ocean/internal/infrastructure/storage/db/inmemory/repo_manager.go:35 +0x39

Goroutine 541 (finished) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1493 +0x75d
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1846 +0x99
  testing.tRunner()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1446 +0x216
  testing.runTests()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1844 +0x7ec
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.19.4/x64/src/testing/testing.go:1726 +0xa84
  github.com/equitas-foundation/bamp-ocean/internal/infrastructure/storage/db/test_test.TestMain()
      /home/runner/work/ocean/ocean/internal/infrastructure/storage/db/test/wallet_repository_test.go:61 +0x9d9
  main.main()
      _testmain.go:53 +0x324