Skip to content

Commit

Permalink
Merge pull request #1236 from carvel-dev/cherry-pick-14e2fb-v0.45.x
Browse files Browse the repository at this point in the history
Merge pull request #1194 from carvel-dev/flaky-test-fix

Fix flaky E2E tests
  • Loading branch information
sethiyash authored Jun 13, 2023
2 parents c002ac1 + 6000323 commit 5635e3a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
28 changes: 28 additions & 0 deletions test/e2e/assets/registry/no-auth-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ kind: Deployment
metadata:
name: simple-registry
namespace: registry
annotations:
kapp.k14s.io/change-group: registry
spec:
replicas: 1
selector:
Expand Down Expand Up @@ -68,3 +70,29 @@ spec:
name: registry-contents
- name: registry-sync
emptyDir: { }

# TODO should we make vendir's http retry within App CR, to avoid
# transient failure when Service=>Deployment networking is not ready?
---
apiVersion: batch/v1
kind: Job
metadata:
name: check-nginx-conn
annotations:
kapp.k14s.io/update-strategy: always-replace
kapp.k14s.io/change-rule: upsert after upserting registry
spec:
backoffLimit: 5
template:
metadata:
name: check-nginx-conn
spec:
containers:
- name: check
image: busybox
command:
- /bin/sh
- "-c"
- |
wget --tries=10 --no-check-certificate http://registry-svc.registry.svc.cluster.local:5050/v2/
restartPolicy: Never
6 changes: 3 additions & 3 deletions test/e2e/kappcontroller/imgpkg_bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func Test_AppCR_FetchFromCaching(t *testing.T) {
// deletes ServiceAccount before App
kubectl.RunWithOpts([]string{"delete", "apps/" + pkgiName}, e2e.RunOpts{AllowError: true})
kapp.Run([]string{"delete", "-a", pkgiName})
kapp.Run([]string{"delete", "-a", registryName, "-n", registryNamespace})
kapp.Run([]string{"delete", "-a", registryName})
}
cleanUp()
defer cleanUp()
Expand Down Expand Up @@ -280,7 +280,7 @@ func Test_PackageRepo_FetchFromCaching(t *testing.T) {

cleanUp := func() {
kapp.Run([]string{"delete", "-a", pkgrName})
kapp.Run([]string{"delete", "-a", registryName, "-n", registryNamespace})
kapp.Run([]string{"delete", "-a", registryName})
}
cleanUp()
defer cleanUp()
Expand Down Expand Up @@ -374,7 +374,7 @@ func Test_PackageRepo_DoesNotFetchFromCaching(t *testing.T) {

cleanUp := func() {
kapp.Run([]string{"delete", "-a", pkgrName})
kapp.Run([]string{"delete", "-a", registryName, "-n", registryNamespace})
kapp.Run([]string{"delete", "-a", registryName})
}
cleanUp()
defer cleanUp()
Expand Down

0 comments on commit 5635e3a

Please sign in to comment.