internal/host/plugin: fix flaky test

Hosts contain IP addresses in string form, whose
order is not defined.
pull/5085/head
Johan Brandhorst-Satzkorn 2 years ago
parent e833d79fc5
commit cece7dbdc2

@ -221,6 +221,9 @@ func TestJob_UpsertHosts(t *testing.T) {
cmpopts.SortSlices(func(x, y *Host) bool {
return x.GetPublicId() < y.GetPublicId()
}),
cmpopts.SortSlices(func(x, y string) bool {
return x < y
}),
),
)
@ -242,6 +245,9 @@ func TestJob_UpsertHosts(t *testing.T) {
cmpopts.SortSlices(func(x, y *Host) bool {
return x.GetPublicId() < y.GetPublicId()
}),
cmpopts.SortSlices(func(x, y string) bool {
return x < y
}),
),
)
plg := plg
@ -274,6 +280,9 @@ func TestJob_UpsertHosts(t *testing.T) {
got,
cmpopts.IgnoreUnexported(Host{}, store.Host{}),
cmpopts.IgnoreTypes(&timestamp.Timestamp{}),
cmpopts.SortSlices(func(x, y string) bool {
return x < y
}),
),
)
assert.Empty(

Loading…
Cancel
Save