diff --git a/tests/object_sync_test.go b/tests/object_sync_test.go index 27d3c9551..8d5971504 100644 --- a/tests/object_sync_test.go +++ b/tests/object_sync_test.go @@ -310,6 +310,24 @@ func TestObjectSync(t *testing.T) { t.Skip() }) + t.Run("Sla History Trail", func(t *testing.T) { + t.Parallel() + + assert.Eventuallyf(t, func() bool { + var count int + err := db.Get(&count, db.Rebind("SELECT COUNT(*) FROM sla_history_trail WHERE service_id IS NULL")) + require.NoError(t, err, "querying hosts sla history trail should not fail") + return count == len(data.Hosts) + }, 20*time.Second, 200*time.Millisecond, "Newly created hosts should exists in database") + + assert.Eventuallyf(t, func() bool { + var count int + err := db.Get(&count, db.Rebind("SELECT COUNT(*) FROM sla_history_trail WHERE service_id IS NOT NULL")) + require.NoError(t, err, "querying services sla history trail should not fail") + return count == len(data.Services) + }, 20*time.Second, 200*time.Millisecond, "Newly created services should exists in database") + }) + t.Run("RuntimeUpdates", func(t *testing.T) { t.Parallel()