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

Remove useless test to fix data race #3625

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

gerardsn
Copy link
Member

fixes race condition

==================
WARNING: DATA RACE
Write at 0x00c000114ca0 by goroutine 797:
  github.com/daangn/minimemcached.(*server).close()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/server.go:27 +0xc4
  github.com/daangn/minimemcached.(*MiniMemcached).Close()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/minimemcached.go:90 +0x77
  github.com/nuts-foundation/nuts-node/storage.memcachedTestServer.func1()
      /home/circleci/project/storage/session_memcached_test.go:180 +0x2e
  testing.(*common).Cleanup.func1()
      /usr/local/go/src/testing/testing.go:1176 +0x179
  testing.(*common).runCleanup()
      /usr/local/go/src/testing/testing.go:1354 +0x261
  testing.tRunner.func2()
      /usr/local/go/src/testing/testing.go:1684 +0x50
  runtime.deferreturn()
      /usr/local/go/src/runtime/panic.go:605 +0x5d
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1743 +0x44

Previous read at 0x00c000114ca0 by goroutine 799:
  github.com/daangn/minimemcached.(*MiniMemcached).serve()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/minimemcached.go:125 +0x4f
  github.com/daangn/minimemcached.(*MiniMemcached).newServer.func1()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/minimemcached.go:119 +0x2e

Goroutine 797 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1743 +0x825
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:2168 +0x85
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x226
  testing.runTests()
      /usr/local/go/src/testing/testing.go:2166 +0x8be
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:2034 +0xf17
  main.main()
      _testmain.go:137 +0x164

Goroutine 799 (finished) created at:
  github.com/daangn/minimemcached.(*MiniMemcached).newServer()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/minimemcached.go:118 +0x8d
  github.com/daangn/minimemcached.(*MiniMemcached).start()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/minimemcached.go:113 +0xe4
  github.com/daangn/minimemcached.Run()
      /home/circleci/go/pkg/mod/github.com/daangn/[email protected]/minimemcached.go:83 +0x6a
  github.com/nuts-foundation/nuts-node/storage.memcachedTestServer()
      /home/circleci/project/storage/session_memcached_test.go:175 +0xc4
  github.com/nuts-foundation/nuts-node/storage.memcachedTestDatabase()
      /home/circleci/project/storage/session_memcached_test.go:157 +0x3b
  github.com/nuts-foundation/nuts-node/storage.TestNewMemcachedSessionDatabase()
      /home/circleci/project/storage/session_memcached_test.go:34 +0x26
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1743 +0x44
==================

@gerardsn gerardsn changed the title Remove useless test Remove useless test to fix data race Dec 18, 2024
Copy link
Member

@woutslakhorst woutslakhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, based on the idea that the other tests use the DB resulting in a "wait for startup" kind of behaviour

@gerardsn gerardsn merged commit e1f5c2b into master Dec 20, 2024
8 of 9 checks passed
@gerardsn gerardsn deleted the fix-datarace-session_memcached_test branch December 20, 2024 12:02
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

Successfully merging this pull request may close these issues.

2 participants