From fe8d40f12c72cf6cb1863aaee29e99831b30ac58 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 9 Nov 2022 11:48:34 +0200 Subject: [PATCH] app/{vminsert,vmselect}: test initialization with different number of storage nodes Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/3329 --- app/vminsert/netstorage/netstorage_test.go | 14 ++++++++++++++ app/vmselect/netstorage/netstorage_test.go | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/app/vminsert/netstorage/netstorage_test.go b/app/vminsert/netstorage/netstorage_test.go index 278ee84686..0a3ce9e38d 100644 --- a/app/vminsert/netstorage/netstorage_test.go +++ b/app/vminsert/netstorage/netstorage_test.go @@ -11,4 +11,18 @@ func TestInitStopNodes(t *testing.T) { 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() + } } diff --git a/app/vmselect/netstorage/netstorage_test.go b/app/vmselect/netstorage/netstorage_test.go index 8a2a0cee27..19d05060e6 100644 --- a/app/vmselect/netstorage/netstorage_test.go +++ b/app/vmselect/netstorage/netstorage_test.go @@ -12,6 +12,20 @@ func TestInitStopNodes(t *testing.T) { runtime.Gosched() MustStop() } + + // Try initializing the netstorage with bigger number of nodes + for i := 0; i < 3; i++ { + Init([]string{"host1", "host2", "host3"}) + runtime.Gosched() + MustStop() + } + + // Try initializing the netstorage with smaller number of nodes + for i := 0; i < 3; i++ { + Init([]string{"host1"}) + runtime.Gosched() + MustStop() + } } func TestMergeSortBlocks(t *testing.T) {