Skip to content

Commit 765a695

Browse files
jorbaumchombium
authored andcommitted
Fix another race condition in the test file
1 parent c9519a3 commit 765a695

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rlp_gateway_client_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ var _ = Describe("RlpGatewayClient", func() {
187187
})
188188
spyDoer.errs = []error{nil}
189189

190+
var senderDone sync.WaitGroup
191+
senderDone.Add(1)
190192
go func() {
193+
defer senderDone.Done()
191194
for i := 0; i < 10; i++ {
192195
b, err := protojson.Marshal(&loggregator_v2.EnvelopeBatch{
193196
Batch: []*loggregator_v2.Envelope{
@@ -215,6 +218,7 @@ var _ = Describe("RlpGatewayClient", func() {
215218
}()
216219

217220
Eventually(envelopes).Should(HaveLen(10))
221+
senderDone.Wait()
218222
})
219223

220224
It("handles heartbeats", func() {

0 commit comments

Comments
 (0)