-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved assertions & resource clean-up for E2E tests #311
Conversation
retrievedTargets, err := testFramework.LatticeClient.ListTargetsAsList(ctx, &vpclattice.ListTargetsInput{ | ||
TargetGroupIdentifier: targetGroup.Id, | ||
}) | ||
Expect(err).ToNot(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could actually remove the whole:
testFramework.ExpectDeleted(ctx, service)
Eventually(func(g Gomega) {
log.Println("Verifying Targets are only craeted for the port defined in Port Annotaion in ServiceExport")
targets := testFramework.GetTargets(ctx, targetGroup, deployment)
Expect(len(targets) == 0)
}).WithTimeout(5*time.Minute + 30*time.Second)
This test case intend to test "Verifying Targets are only created for the port defined in Port Annotation in ServiceExport", and the delete k8sService and verify 0 targets don't need to be part of this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I have removed it now
Logger(ctx).Infof("Target group %s no longer has targets registered. Deleting now.", *tgId) | ||
Eventually(func() bool { | ||
_, err := env.LatticeClient.DeleteTargetGroup(&vpclattice.DeleteTargetGroupInput{ | ||
TargetGroupIdentifier: tgId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Pull Request Test Coverage Report for Build 5764738532
💛 - Coveralls |
@@ -35,7 +34,7 @@ func NewDefaultLattice(sess *session.Session, region string) *defaultLattice { | |||
endpoint = latticeEndpoint | |||
} | |||
|
|||
latticeSess = vpclattice.New(sess, aws.NewConfig().WithRegion(region).WithEndpoint(endpoint)) | |||
latticeSess = vpclattice.New(sess, aws.NewConfig().WithRegion(region).WithEndpoint(endpoint).WithMaxRetries(20)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 20 retries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VPC lattice cp api have pretty low per account throttling setting, controller and e2etest code can quite easily get "Too Many Request" error if we use default max retry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these retries with exponential backoff? or whats the retry strategy?
overall looks good |
What type of PR is this?
Bug
Which issue does this PR fix:
This addresses E2E reliability by improving assertions and clean-up of resources that may leak during E2E test executions. It also addresses Amazon VPC Lattice throttling exceptions by introducing a retry strategy for the VPC Lattice client.
What does this PR do / Why do we need it:
This improves the reliability of existing E2E tests.
Testing done on this change:
Automation added to e2e:
N/A
Will this PR introduce any new dependencies?:
No.
Will this break upgrades or downgrades. Has updating a running cluster been tested?:
This will not break upgrades or downgrades. These changes were tested on the latest
v0.0.15
release.Does this PR introduce any user-facing change?:
No.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.