livelog: remove potential race conditions from tests

This commit is contained in:
Lars Lehtonen 2019-09-18 00:40:40 -07:00
parent 6283b20972
commit a7389057b0
2 changed files with 2 additions and 5 deletions

View file

@ -27,10 +27,8 @@ func TestStreamer(t *testing.T) {
}
w := sync.WaitGroup{}
w.Add(1)
w.Add(4)
go func() {
w.Add(3)
s.Write(context.Background(), 1, &core.Line{})
s.Write(context.Background(), 1, &core.Line{})
s.Write(context.Background(), 1, &core.Line{})

View file

@ -34,9 +34,8 @@ func TestStream(t *testing.T) {
stream, errc := s.subscribe(ctx)
w.Add(1)
w.Add(4)
go func() {
w.Add(3)
s.write(&core.Line{Number: 4})
s.write(&core.Line{Number: 5})
s.write(&core.Line{Number: 6})