Fix flaky test TestServer_ConcurrentPointsWriter_Subscriber
The LocalServer could be closed before the goroutine writing points exited causing nil pointer panic. Fixes #9583pull/9621/head
parent
477de23e35
commit
8730be1e9f
|
@ -9158,7 +9158,10 @@ func TestServer_ConcurrentPointsWriter_Subscriber(t *testing.T) {
|
|||
}
|
||||
// goroutine to write points
|
||||
done := make(chan struct{})
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for {
|
||||
select {
|
||||
case <-done:
|
||||
|
@ -9176,6 +9179,7 @@ func TestServer_ConcurrentPointsWriter_Subscriber(t *testing.T) {
|
|||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
close(done)
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
// Ensure time in where clause is inclusive
|
||||
|
|
Loading…
Reference in New Issue