Skip to content

Commit ba540ef

Browse files
committed
fix(e2e): nil-guard port-forward kill, remove sleep, align GO_VERSION with go.mod
1 parent c8952a8 commit ba540ef

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
env:
10-
GO_VERSION: "1.24"
10+
GO_VERSION: "1.25"
1111

1212
jobs:
1313
lint:

test/e2e/e2e_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,13 @@ spec:
127127
fmt.Sprintf("svc/%s-operator", helmRelease),
128128
"18080:8080", "-n", namespace)
129129
Expect(pf.Start()).To(Succeed())
130-
defer pf.Process.Kill() //nolint:errcheck
131-
132-
time.Sleep(2 * time.Second)
130+
DeferCleanup(func() {
131+
if pf.Process != nil {
132+
_ = pf.Process.Kill()
133+
}
134+
})
133135

136+
// Eventually handles connection-refused while port-forward is starting up.
134137
Eventually(func(g Gomega) {
135138
resp, err := http.Get("http://localhost:18080/metrics") //nolint:noctx
136139
g.Expect(err).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)