Skip to content

Commit ca884a9

Browse files
committed
test: fix GC tests for macOS
1 parent c9db552 commit ca884a9

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

controllers/helmchart_controller_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,15 @@ var _ = Describe("HelmChartReconciler", func() {
157157
return k8sClient.Get(context.Background(), key, c)
158158
}).ShouldNot(Succeed())
159159

160+
exists := func(path string) bool {
161+
// wait for tmp sync on macOS
162+
time.Sleep(time.Second)
163+
_, err := os.Stat(path)
164+
return err == nil
165+
}
166+
160167
By("Expecting GC on delete")
161-
Eventually(storage.ArtifactExist(*got.Status.Artifact), timeout, interval).ShouldNot(BeTrue())
168+
Eventually(exists(got.Status.Artifact.Path), timeout, interval).ShouldNot(BeTrue())
162169
})
163170

164171
It("Filters versions", func() {

controllers/helmrepository_controller_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,15 @@ var _ = Describe("HelmRepositoryReconciler", func() {
139139
return k8sClient.Get(context.Background(), key, r)
140140
}).ShouldNot(Succeed())
141141

142+
exists := func(path string) bool {
143+
// wait for tmp sync on macOS
144+
time.Sleep(time.Second)
145+
_, err := os.Stat(path)
146+
return err == nil
147+
}
148+
142149
By("Expecting GC after delete")
143-
Eventually(storage.ArtifactExist(*got.Status.Artifact), timeout, interval).ShouldNot(BeTrue())
150+
Eventually(exists(got.Status.Artifact.Path), timeout, interval).ShouldNot(BeTrue())
144151
})
145152

146153
It("Authenticates when basic auth credentials are provided", func() {

0 commit comments

Comments
 (0)