Skip to content

Commit

Permalink
test fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Jun 11, 2024
1 parent 3e32df6 commit 6f7b04d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions events/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ func TestSimpleSubscribersDontRecieveItemsAfterUnsubscribing(t *testing.T) {
assert.Equal(t, 0, <-ch)
}
func TestSimpleEachSubscribersRecievesEachItemGivenBufferedEventChan2(t *testing.T) {
c := NewSimpleChannel[Update](10000000, 5)
for i := 0; i < 1000; i++ {
c := NewSimpleChannel[Update](1000000, 5)
for i := 0; i < 100; i++ {
sub, err := c.Subscribe()
if err != nil {
panic(err)
}
defer c.Unsubscribe(sub)
go handleChannelMessages(sub)
}
for i := 0; i < 100; i++ {
for i := 0; i < 1000; i++ {
c.Publish(
Update{
DocID: "test",
Expand All @@ -129,6 +129,6 @@ func TestSimpleEachSubscribersRecievesEachItemGivenBufferedEventChan2(t *testing
func handleChannelMessages(sub Subscription[Update]) {
for msg := range sub {
_ = msg
time.Sleep(100 * time.Millisecond)
time.Sleep(1 * time.Millisecond)
}
}

0 comments on commit 6f7b04d

Please sign in to comment.