Check fields in testutil AssertDoesNotContainsTaggedFields (#5365)

This commit is contained in:
Grace Do 2019-02-01 16:20:24 -08:00 committed by Daniel Nelson
parent a98483cc11
commit 15c65b08e5
1 changed files with 4 additions and 3 deletions

View File

@ -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)
}
}