good morning!!!!

Skip to content
Snippets Groups Projects
Commit bed9bbf7 authored by Garet Halliday's avatar Garet Halliday
Browse files

ah

parent e7132c8e
No related branches found
No related tags found
1 merge request!35fix tests
Pipeline #33253 passed with stage
in 7 minutes and 34 seconds
......@@ -76,6 +76,10 @@ func (c *WrapClient) Subscribe(ctx context.Context, namespace string, channel an
return nil, ErrSubscriptionNotFound
}
// FIXME(garet): we can lose subscription messages here. if they send a notification and the server handles it
// before we finish adding it to the subs, the message will be lost. Ping will almost always be much much longer
// than us adding the sub so it probably doesn't matter. but it fails the unit tests :(
// now create a client sub
sub := &clientSub{
engine: c,
......
......@@ -28,11 +28,14 @@ func TestSubscription(t *testing.T) {
return
}
for i := 0; i < count; i++ {
if err := notifier.Notify(i); err != nil {
panic(err)
go func() {
time.Sleep(10 * time.Millisecond)
for i := 0; i < count; i++ {
if err := notifier.Notify(i); err != nil {
panic(err)
}
}
}
}()
})
srv := server.NewServer(r)
......@@ -80,11 +83,14 @@ func TestUnsubscribeNoRead(t *testing.T) {
return
}
for i := 0; i < 10; i++ {
if err := notifier.Notify(i); err != nil {
panic(err)
go func() {
time.Sleep(10 * time.Millisecond)
for i := 0; i < 10; i++ {
if err := notifier.Notify(i); err != nil {
panic(err)
}
}
}
}()
})
srv := server.NewServer(r)
......@@ -136,6 +142,7 @@ func TestWrapClient(t *testing.T) {
return
}
go func() {
time.Sleep(10 * time.Millisecond)
idx := 0
for {
select {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment