mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
4f53147ed4
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.
14 lines
195 B
Go
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()
|
|
}
|
|
}
|