Skip to content

Conversation

@zijun726911
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Equal(vpclattice.TargetStatusInitial),
Equal(vpclattice.TargetStatusHealthy),
))
}
Copy link
Contributor Author

@zijun726911 zijun726911 Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g.Expect(len(targets)).To(BeEquivalentTo(*deployments[i].Spec.Replicas))

Old code forget to do assertion on the retrieved targets length, That could cause before setup complete and the targets haven't yet being created, it could wrongly slips to the below 2 test cases. And the verifyNoTargetsForTargetGroup() just pass not because of the controller "Kubernetes Deployment deletion triggers targets de-registering" behavior but due to test setup incomplete.


It("Kubernetes Deployment deletion triggers targets de-registering", func() {
testFramework.ExpectDeleted(ctx, services[1])
testFramework.ExpectDeleted(ctx, deployments[1])
Copy link
Contributor Author

@zijun726911 zijun726911 Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a typo. this test intend to do: "Kubernetes Deployment deletion triggers targets de-registering"

Equal(vpclattice.TargetStatusHealthy),
))
}
}).Should(Succeed())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add timeout, polling rate

Comment on lines 60 to 64
g.Expect(*target.Port).To(BeEquivalentTo(service.Spec.Ports[0].TargetPort.IntVal))
g.Expect(*target.Status).To(Or(
Equal(vpclattice.TargetStatusInitial),
Equal(vpclattice.TargetStatusHealthy),
))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you need any of these?

Copy link
Contributor Author

@zijun726911 zijun726911 Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to do some assertions to confirm lattice targets setup success. otherwise below test cases could wrong pass due to incomplete pre-test setup

Copy link
Contributor

@mikhail-aws mikhail-aws Nov 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we wait for Healthy status only? If we succeed on TargetStatusInitial, it's almost same as not doing assertions

@mikhail-aws mikhail-aws merged commit 63fafa2 into aws:main Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants