test: fix flaky test TestEventBufferFuzz (#13175)

This commit is contained in:
R.B. Boyer 2022-05-23 09:22:30 -05:00 committed by GitHub
parent c629e89289
commit 3b12a5179f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -22,6 +22,10 @@ func TestEventBufferFuzz(t *testing.T) {
b := newEventBuffer()
// Load head here so all subscribers start from the same point or they might
// not run until several appends have already happened.
head := b.Head()
// Start a write goroutine that will publish 10000 messages with sequential
// indexes and some jitter in timing (to allow clients to "catch up" and block
// waiting for updates).
@ -50,10 +54,6 @@ func TestEventBufferFuzz(t *testing.T) {
// Run n subscribers following and verifying
errCh := make(chan error, nReaders)
// Load head here so all subscribers start from the same point or they might
// not run until several appends have already happened.
head := b.Head()
for i := 0; i < nReaders; i++ {
go func(i int) {
expect := uint64(0)