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