From ab8b4c9c0e9297b0f085df2e79158074a16a89f9 Mon Sep 17 00:00:00 2001 From: Mihail Stoykov Date: Fri, 7 Jun 2024 10:36:58 +0300 Subject: [PATCH] Drop direct usage of Group See https://github.com/grafana/k6/pull/3750 for more info. --- kafka_helpers_test.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/kafka_helpers_test.go b/kafka_helpers_test.go index 0d63fa9..ea17231 100644 --- a/kafka_helpers_test.go +++ b/kafka_helpers_test.go @@ -2,7 +2,6 @@ package kafka import ( "context" - "errors" "testing" "github.com/dop251/goja" @@ -64,10 +63,6 @@ func getTestModuleInstance(tb testing.TB) *kafkaTest { // moveToVUCode moves to the VU code from the init code (to test certain functions). func (k *kafkaTest) moveToVUCode() error { - rootGroup, err := lib.NewGroup("", nil) - if err != nil { - return errors.Unwrap(err) - } samples := make(chan metrics.SampleContainer, 1000) // Save it, so we can reuse it in other tests k.samples = samples @@ -75,20 +70,13 @@ func (k *kafkaTest) moveToVUCode() error { registry := metrics.NewRegistry() state := &lib.State{ - Group: rootGroup, Options: lib.Options{ UserAgent: null.StringFrom("TestUserAgent"), Paused: null.BoolFrom(false), }, - BufferPool: lib.NewBufferPool(), - Samples: k.samples, - Tags: lib.NewVUStateTags( - registry.RootTagSet().WithTagsFromMap( - map[string]string{ - "group": rootGroup.Path, - }, - ), - ), + BufferPool: lib.NewBufferPool(), + Samples: k.samples, + Tags: lib.NewVUStateTags(registry.RootTagSet()), BuiltinMetrics: metrics.RegisterBuiltinMetrics(registry), } k.vu.StateField = state