Skip to content

Commit cabb448

Browse files
change WaitGroup to mutex (#3099)
Signed-off-by: João Pereira <[email protected]>
1 parent 00775a2 commit cabb448

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cf/commands/application/start_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ var _ = Describe("start command", func() {
152152
logRepo = new(logsfakes.FakeRepository)
153153
logMessages.Store([]logs.Loggable{})
154154

155-
closeWait := sync.WaitGroup{}
156-
closeWait.Add(1)
155+
m := sync.Mutex{}
156+
m.Lock()
157157

158158
logRepo.TailLogsForStub = func(appGUID string, onConnect func(), logChan chan<- logs.Loggable, errChan chan<- error) {
159159
onConnect()
@@ -163,13 +163,13 @@ var _ = Describe("start command", func() {
163163
logChan <- log
164164
}
165165

166-
closeWait.Wait()
166+
m.Lock()
167167
close(logChan)
168168
}()
169169
}
170170

171171
logRepo.CloseStub = func() {
172-
closeWait.Done()
172+
m.Unlock()
173173
}
174174
})
175175

0 commit comments

Comments
 (0)