diff --git a/internal/controllers/synthesis/integration_test.go b/internal/controllers/synthesis/integration_test.go index face4c7a..40d376c1 100644 --- a/internal/controllers/synthesis/integration_test.go +++ b/internal/controllers/synthesis/integration_test.go @@ -71,19 +71,16 @@ func TestControllerHappyPath(t *testing.T) { latest := comp.Generation testutil.Eventually(t, func() bool { require.NoError(t, cli.Get(ctx, client.ObjectKeyFromObject(comp), comp)) - return comp.Status.CurrentState != nil && comp.Status.CurrentState.ObservedCompositionGeneration == latest + return comp.Status.CurrentState != nil && comp.Status.CurrentState.ObservedCompositionGeneration >= latest }) // The previous state is retained if comp.Status.PreviousState == nil { t.Error("state wasn't swapped to previous") - } else { - assert.Equal(t, comp.Generation-1, comp.Status.PreviousState.ObservedCompositionGeneration) } }) t.Run("synthesizer update", func(t *testing.T) { - prevSynGen := syn.Generation err := retry.RetryOnConflict(retry.DefaultBackoff, func() error { if err := cli.Get(ctx, client.ObjectKeyFromObject(syn), syn); err != nil { return err @@ -95,14 +92,12 @@ func TestControllerHappyPath(t *testing.T) { testutil.Eventually(t, func() bool { require.NoError(t, cli.Get(ctx, client.ObjectKeyFromObject(comp), comp)) - return comp.Status.CurrentState != nil && comp.Status.CurrentState.ObservedSynthesizerGeneration == syn.Generation + return comp.Status.CurrentState != nil && comp.Status.CurrentState.ObservedSynthesizerGeneration >= syn.Generation }) // The previous state is retained if comp.Status.PreviousState == nil { t.Error("state wasn't swapped to previous") - } else { - assert.Equal(t, prevSynGen, comp.Status.PreviousState.ObservedSynthesizerGeneration) } })