mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
32 lines
662 B
Go
32 lines
662 B
Go
package netstorage
|
|
|
|
import (
|
|
"flag"
|
|
"runtime"
|
|
"testing"
|
|
)
|
|
|
|
func TestInitStopNodes(t *testing.T) {
|
|
if err := flag.Set("vmstorageDialTimeout", "1ms"); err != nil {
|
|
t.Fatalf("cannot set vmstorageDialTimeout flag: %s", err)
|
|
}
|
|
for i := 0; i < 3; i++ {
|
|
Init([]string{"host1", "host2"}, 0)
|
|
runtime.Gosched()
|
|
MustStop()
|
|
}
|
|
|
|
// Try initializing the netstorage with bigger number of nodes
|
|
for i := 0; i < 3; i++ {
|
|
Init([]string{"host1", "host2", "host3"}, 0)
|
|
runtime.Gosched()
|
|
MustStop()
|
|
}
|
|
|
|
// Try initializing the netstorage with smaller number of nodes
|
|
for i := 0; i < 3; i++ {
|
|
Init([]string{"host1"}, 0)
|
|
runtime.Gosched()
|
|
MustStop()
|
|
}
|
|
}
|