diff --git a/discovery/file/file_test.go b/discovery/file/file_test.go index b473c2ce6e..521a3c0f16 100644 --- a/discovery/file/file_test.go +++ b/discovery/file/file_test.go @@ -358,7 +358,7 @@ func TestInvalidFile(t *testing.T) { // Verify that we've received nothing. time.Sleep(defaultWait) - require.False(t, runner.lastReceive().After(now), "Unexpected targets received.") + require.False(t, runner.lastReceive().After(now), "unexpected targets received: %v", runner.targets()) }) } } diff --git a/discovery/marathon/marathon_test.go b/discovery/marathon/marathon_test.go index c9555e9d31..659899f163 100644 --- a/discovery/marathon/marathon_test.go +++ b/discovery/marathon/marathon_test.go @@ -152,8 +152,8 @@ func TestMarathonSDRemoveApp(t *testing.T) { tg2 := tgs[0] - require.Equal(t, tg1.Source, tg2.Source, "Source is different.") require.NotEmpty(t, tg2.Targets, "Got a non-empty target set.") + require.Equal(t, tg1.Source, tg2.Source, "Source is different.") } func marathonTestAppListWithMultiplePorts(labels map[string]string, runningTasks int) *appList { @@ -307,7 +307,7 @@ func TestMarathonSDSendGroupWithPortDefinitions(t *testing.T) { tgt = tg.Targets[1] require.Equal(t, "mesos-slave1:5678", string(tgt[model.AddressLabel]), "Wrong target address.") - require.Equal(t, "", string(tgt[model.LabelName(portMappingLabelPrefix+"prometheus")]), "Wrong portMappings label from the second port.") + require.Empty(t, tgt[model.LabelName(portMappingLabelPrefix+"prometheus")], "Wrong portMappings label from the second port.") require.Equal(t, "yes", string(tgt[model.LabelName(portDefinitionLabelPrefix+"prometheus")]), "Wrong portDefinitions label from the second port.") }