VictoriaMetrics/app/vminsert/netstorage/netstorage_test.go
Aliaksandr Valialkin 4f53147ed4
app/{vminsert,vmselect}/netstorage: allow calling Init()+MustStop() in a loop
Previously netstorage.MustStop() call didn't free up all the resources,
so the subsequent call to nestorage.Init() would panic.

This allows writing tests, which call nestorage.Init() + nestorage.MustStop() in a loop.
2022-10-25 14:43:05 +03:00

14 lines
195 B
Go

package netstorage
import (
"runtime"
"testing"
)
func TestInitStopNodes(t *testing.T) {
for i := 0; i < 3; i++ {
Init([]string{"host1", "host2"}, 0)
runtime.Gosched()
MustStop()
}
}