Skip to content

Commit

Permalink
tests: Get BuildRun before parent Build is deleted
Browse files Browse the repository at this point in the history
When testing if a BuildRun is cleaned up by k8s garbage collection, we
need to get the BuildRun object before we delete the parent Build
object. Our test cluster in Travis probably didn't catch this because of
weak resource constraints. This test fails when run against a
production-grade cluster.
  • Loading branch information
adambkaplan committed Nov 11, 2020
1 parent c2e796a commit 1dd8bfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/integration/build_to_buildruns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,13 +435,13 @@ var _ = Describe("Integration tests Build and BuildRuns", func() {
Expect(err).To(BeNil())
Expect(patchedBuild.Annotations[v1alpha1.AnnotationBuildRunDeletion]).To(Equal("true"))

err = tb.DeleteBuild(BUILD + tb.Namespace)
Expect(err).To(BeNil())

br, err := tb.GetBR(BUILDRUN + tb.Namespace)
Expect(err).To(BeNil())
Expect(ownerReferenceNames(br.OwnerReferences)).Should(ContainElement(buildObject.Name))

err = tb.DeleteBuild(BUILD + tb.Namespace)
Expect(err).To(BeNil())

buildIsDeleted, err := tb.GetBRTillDeletion(BUILDRUN + tb.Namespace)
Expect(err).To(BeNil())
Expect(buildIsDeleted).To(Equal(true))
Expand Down

0 comments on commit 1dd8bfd

Please sign in to comment.