livelog: remove potential race conditions from tests
This commit is contained in:
parent
6283b20972
commit
a7389057b0
2 changed files with 2 additions and 5 deletions
|
@ -27,10 +27,8 @@ func TestStreamer(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
w := sync.WaitGroup{}
|
w := sync.WaitGroup{}
|
||||||
w.Add(1)
|
w.Add(4)
|
||||||
|
|
||||||
go func() {
|
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{})
|
s.Write(context.Background(), 1, &core.Line{})
|
||||||
s.Write(context.Background(), 1, &core.Line{})
|
s.Write(context.Background(), 1, &core.Line{})
|
||||||
|
|
|
@ -34,9 +34,8 @@ func TestStream(t *testing.T) {
|
||||||
|
|
||||||
stream, errc := s.subscribe(ctx)
|
stream, errc := s.subscribe(ctx)
|
||||||
|
|
||||||
w.Add(1)
|
w.Add(4)
|
||||||
go func() {
|
go func() {
|
||||||
w.Add(3)
|
|
||||||
s.write(&core.Line{Number: 4})
|
s.write(&core.Line{Number: 4})
|
||||||
s.write(&core.Line{Number: 5})
|
s.write(&core.Line{Number: 5})
|
||||||
s.write(&core.Line{Number: 6})
|
s.write(&core.Line{Number: 6})
|
||||||
|
|
Loading…
Reference in a new issue