mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-19 15:30:17 +00:00
app/{vminsert,vmselect}: speed up TestInitStopNodes()
This commit is contained in:
parent
a13d21513e
commit
3a25a4b1de
2 changed files with 8 additions and 0 deletions
app
|
@ -1,11 +1,15 @@
|
||||||
package netstorage
|
package netstorage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInitStopNodes(t *testing.T) {
|
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++ {
|
for i := 0; i < 3; i++ {
|
||||||
Init([]string{"host1", "host2"}, 0)
|
Init([]string{"host1", "host2"}, 0)
|
||||||
runtime.Gosched()
|
runtime.Gosched()
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
package netstorage
|
package netstorage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestInitStopNodes(t *testing.T) {
|
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++ {
|
for i := 0; i < 3; i++ {
|
||||||
Init([]string{"host1", "host2"})
|
Init([]string{"host1", "host2"})
|
||||||
runtime.Gosched()
|
runtime.Gosched()
|
||||||
|
|
Loading…
Reference in a new issue