Skip to content

flaky: enterprise/replicasync race detected during execution of test #5286

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

Closed
mtojek opened this issue Dec 5, 2022 · 2 comments · Fixed by #5289
Closed

flaky: enterprise/replicasync race detected during execution of test #5286

mtojek opened this issue Dec 5, 2022 · 2 comments · Fixed by #5289
Assignees

Comments

@mtojek
Copy link
Member

mtojek commented Dec 5, 2022

Spotted in: https://github.com/coder/coder/actions/runs/3605282480/jobs/6075510642

=== Failed
=== FAIL: enterprise/replicasync TestReplica/TwentyConcurrent (1.27s)
    testing.go:1319: race detected during execution of test
    --- FAIL: TestReplica/TwentyConcurrent (1.27s)

=== FAIL: enterprise/replicasync TestReplica (0.00s)

DONE 2515 tests, 11 skipped, 2 failures in 162.177s
make: *** [Makefile:476: test-postgres] Error 1
Error: Process completed with exit code 2.
@mtojek mtojek added the flake label Dec 5, 2022
@mtojek mtojek self-assigned this Dec 5, 2022
@mtojek
Copy link
Member Author

mtojek commented Dec 5, 2022

==================
WARNING: DATA RACE
Read at 0x00c0004ead78 by goroutine 27609:
  github.com/coder/coder/enterprise/replicasync.(*Manager).syncReplicas()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:286 +0x728
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:174 +0x6c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c

Previous write at 0x00c0004ead78 by goroutine 27590:
  github.com/coder/coder/enterprise/replicasync.(*Manager).syncReplicas()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:303 +0xaac
  github.com/coder/coder/enterprise/replicasync.(*Manager).loop()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:153 +0x3d0
  github.com/coder/coder/enterprise/replicasync.New.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:104 +0x4c

Goroutine 27609 (running) created at:
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func2()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:204 +0x304
  github.com/coder/coder/coderd/database.(*memoryPubsub).Publish.func2()
      /Users/mtojek/code/coder/coderd/database/pubsub_memory.go:50 +0x78

Goroutine 27590 (running) created at:
  github.com/coder/coder/enterprise/replicasync.New()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:104 +0xf58
  github.com/coder/coder/enterprise/replicasync_test.TestReplica.func7()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync_test.go:201 +0x334
  testing.tRunner()
      /nix/store/z4g4l0l34cpd6clrjzmnhgiiyxjx1nzv-go-1.19/share/go/src/testing/testing.go:1446 +0x188
  testing.(*T).Run.func1()
      /nix/store/z4g4l0l34cpd6clrjzmnhgiiyxjx1nzv-go-1.19/share/go/src/testing/testing.go:1493 +0x40
==================

@mtojek
Copy link
Member Author

mtojek commented Dec 5, 2022

One more discovered:

==================
WARNING: DATA RACE
Read at 0x00c00155794f by goroutine 100843:
  github.com/coder/coder/enterprise/replicasync_test.TestReplica.func7.3()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync_test.go:213 +0x58

Previous write at 0x00c00155794f by goroutine 100458:
  github.com/coder/coder/enterprise/replicasync_test.TestReplica.func7.3()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync_test.go:216 +0x78

Goroutine 100843 (running) created at:
  github.com/coder/coder/enterprise/replicasync.(*Manager).syncReplicas()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:305 +0xb20
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:174 +0x6c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c

Goroutine 100458 (finished) created at:
  github.com/coder/coder/enterprise/replicasync.(*Manager).syncReplicas()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:305 +0xb20
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:174 +0x6c
  github.com/coder/coder/enterprise/replicasync.(*Manager).subscribe.func1()
      /Users/mtojek/code/coder/enterprise/replicasync/replicasync.go:182 +0x20c

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 a pull request may close this issue.

1 participant