Closed michaelbeaumont closed 3 years ago
I've "fixed" the tests with a wait but the right way to do it is to have Start()
(or IsRunning()
at least) return a chan struct{}
that can be checked to see if the server is running and then close
this channel when messagePump
exits, but that requires interface changes.
@lorenzodonini Are you happy with IsRunning
not "immediately" returning false
for now?
@lorenzodonini Are you happy with
IsRunning
not "immediately" returningfalse
for now?
I think it's fine for now.
I'm honestly skeptical to adding a channel for this purpose though: client.go
doesn't have an event loop, so it would be impractical to check whether that new channel was closed in any way.
I'll think about a possible alternative. Merging this for now 👍
I was just playing around with
go.uber.org/goleak
and sawmessagePump
hanging around quite often. If we immediately setd.requestChannel
tonil
andmessagePump
isn't already waiting to select fromd.requestChannel
, it will neverreturn
.messagePump
already sets the channel tonil
as well.