Skip to content

Commit 1b38c92

Browse files
chore: add CI runner disk space cleanup, flaky test fix
1 parent e159560 commit 1b38c92

File tree

5 files changed

+37
-5
lines changed

5 files changed

+37
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ jobs:
190190
- name: Checkout code
191191
uses: actions/checkout@v6
192192

193+
- name: Free disk space
194+
uses: jlumbroso/free-disk-space@v1.3.0
195+
193196
- name: Set up Go
194197
uses: actions/setup-go@v6
195198
with:
@@ -233,7 +236,7 @@ jobs:
233236
overwrite: true
234237

235238
e2e-test:
236-
needs: [ lint, build_and_test ]
239+
needs: [ lint ]
237240
strategy:
238241
fail-fast: false
239242
matrix:
@@ -277,13 +280,13 @@ jobs:
277280
if: ${{ !cancelled() }}
278281
steps:
279282
- name: Download all compat test reports
280-
uses: actions/download-artifact@v6
283+
uses: actions/download-artifact@v8
281284
with:
282285
pattern: compat-e2e-report-*
283286

284287

285288
- name: Download all e2e test reports
286-
uses: actions/download-artifact@v6
289+
uses: actions/download-artifact@v8
287290
with:
288291
pattern: e2e-report-*
289292

.github/workflows/release-main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
uses: actions/checkout@v6
2020
with:
2121
fetch-tags: true
22+
- name: Free disk space
23+
uses: jlumbroso/free-disk-space@v1.3.0
2224
- name: Set up Go
2325
uses: actions/setup-go@v6
2426
with:

.github/workflows/release.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
steps:
2323
- name: Checkout code
2424
uses: actions/checkout@v6
25+
- name: Free disk space
26+
uses: jlumbroso/free-disk-space@v1.3.0
2527
- name: Log in to the Container registry
2628
uses: docker/login-action@v4
2729
with:
@@ -38,6 +40,8 @@ jobs:
3840
steps:
3941
- name: Checkout code
4042
uses: actions/checkout@v6
43+
- name: Free disk space
44+
uses: jlumbroso/free-disk-space@v1.3.0
4145
- name: Log in to the Container registry
4246
uses: docker/login-action@v4
4347
with:

internal/controller/clickhouse/commands_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ var _ = Describe("commander", Ordered, Label("integration"), func() {
140140
})
141141

142142
chPort := strconv.FormatInt(PortNative, 10) + "/tcp"
143+
chHTTPPort := strconv.FormatInt(PortHTTP, 10) + "/tcp"
143144
conns := map[v1.ClickHouseReplicaID]clickhouse.Conn{}
144145

145146
for i := range testReplicas {
@@ -164,8 +165,8 @@ var _ = Describe("commander", Ordered, Label("integration"), func() {
164165
FileMode: 0o644,
165166
},
166167
},
167-
ExposedPorts: []string{chPort},
168-
WaitingFor: wait.ForListeningPort(nat.Port(chPort)),
168+
ExposedPorts: []string{chPort, chHTTPPort},
169+
WaitingFor: wait.ForHTTP("/").WithPort(nat.Port(chHTTPPort)).WithStartupTimeout(2 * time.Minute),
169170
},
170171
Started: true,
171172
})

test/deploy/deploy_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,32 @@ var _ = Describe("OLM deployment", Ordered, Label("olm"), func() {
223223
_ = testutil.UninstallCRDs(ctx)
224224
})
225225

226+
DeferCleanup(func(ctx context.Context) {
227+
if !CurrentSpecReport().Failed() {
228+
return
229+
}
230+
231+
By("dumping OLM state for debugging")
232+
233+
for _, resource := range []string{"catalogsources", "subscriptions", "installplans", "clusterserviceversions"} {
234+
out, _ := testutil.Run(exec.CommandContext(ctx, "kubectl", "get", resource,
235+
"-n", namespace, "-o", "wide"))
236+
AddReportEntry("=== OLM "+resource, string(out))
237+
}
238+
})
239+
226240
By("waiting for catalog server to be ready")
227241
runCmd(ctx, "kubectl", "wait", "-n", namespace, "--timeout=120s",
228242
"--for=condition=Ready", "pod/test-catalog-server")
229243

244+
By("waiting for ClusterServiceVersion to succeed")
245+
Eventually(func(g Gomega) {
246+
out, err := testutil.Run(exec.CommandContext(ctx, "kubectl", "get", "csv",
247+
"-n", namespace, "--no-headers", "-o", "custom-columns=PHASE:.status.phase"))
248+
g.Expect(err).ToNot(HaveOccurred(), string(out))
249+
g.Expect(strings.TrimSpace(string(out))).To(Equal("Succeeded"), "CSV phase: %s", strings.TrimSpace(string(out)))
250+
}, "5m", "5s").Should(Succeed())
251+
230252
By("Waiting controller to be ready")
231253
Eventually(func(g Gomega) {
232254
out, err := testutil.Run(exec.CommandContext(ctx, "kubectl", "wait", "-n", namespace,

0 commit comments

Comments
 (0)