From 15c65b08e59ba4b190529f81cb06e730c6d95f32 Mon Sep 17 00:00:00 2001 From: Grace Do Date: Fri, 1 Feb 2019 16:20:24 -0800 Subject: [PATCH] Check fields in testutil AssertDoesNotContainsTaggedFields (#5365) --- testutil/accumulator.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testutil/accumulator.go b/testutil/accumulator.go index 65c8883e0..3fe291699 100644 --- a/testutil/accumulator.go +++ b/testutil/accumulator.go @@ -340,9 +340,10 @@ func (a *Accumulator) AssertDoesNotContainsTaggedFields( continue } - if p.Measurement == measurement { - assert.Equal(t, fields, p.Fields) - msg := fmt.Sprintf("found measurement %s with tags %v which should not be there", measurement, tags) + if p.Measurement == measurement && reflect.DeepEqual(fields, p.Fields) { + msg := fmt.Sprintf( + "found measurement %s with tagged fields (tags %v) which should not be there", + measurement, tags) assert.Fail(t, msg) } }