force detection of new version
@@ -218,10 +218,13 @@ var _ = Describe(":life Garbage collecting resource cache volumes", func() {
}
}
Expect(originalResourceVolumeHandles).To(HaveLen(1))
- //
+
By("creating a new resource version")
gitRepo.CommitAndPush()
- //
+
+ By("detecting the new version")
+ fly("check-resource", "-r", "volume-gc-test/some-repo")
+
By("not expiring the resource cache volume for the ongoing build")
Consistently(func() []string {
volumes := flyTable("volumes")
@@ -232,7 +235,7 @@ var _ = Describe(":life Garbage collecting resource cache volumes", func() {
}
}
return resourceVolumeHandles
- }, 5*time.Second).Should(ContainElement(originalResourceVolumeHandles[0]))
+ }).Should(ContainElement(originalResourceVolumeHandles[0]))
By("hijacking the build to tell it to finish")
hijackSession := spawnFly(
@@ -249,10 +252,6 @@ var _ = Describe(":life Garbage collecting resource cache volumes", func() {
<-watchSession.Exited
Expect(watchSession.ExitCode()).To(Equal(0))
- By("triggering the job")
- hijackSession = spawnFly("trigger-job", "-w", "-j", "volume-gc-test/simple-job")
- Eventually(watchSession).Should(gbytes.Say("waiting for /tmp/stop-waiting"))
-
By("eventually expiring the resource cache volume")
Eventually(func() []string {
volumes := flyTable("volumes")
@@ -264,23 +263,7 @@ var _ = Describe(":life Garbage collecting resource cache volumes", func() {
}
}
return resourceVolumeHandles
- }, 1*time.Minute, 10*time.Second).ShouldNot(ContainElement(originalResourceVolumeHandles[0]))
-
- By("hijacking the build to tell it to finish")
- hijackSession = spawnFly(
- "hijack",
- "-j", "volume-gc-test/simple-job",
- "-s", "wait",
- "touch", "/tmp/stop-waiting",
- )
- <-hijackSession.Exited
- Expect(hijackSession.ExitCode()).To(Equal(0))
-
- By("waiting for the build to exit")
- Eventually(watchSession, 1*time.Minute).Should(gbytes.Say("done"))
- <-watchSession.Exited
- Expect(watchSession.ExitCode()).To(Equal(0))
-
+ }).ShouldNot(ContainElement(originalResourceVolumeHandles[0]))
})
})
})
