Skip to content

Commit e5a164a

Browse files
committed
add kernel limit job
1 parent e878ef0 commit e5a164a

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

hack/ci/kernel.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: kernel-limits
5+
namespace: default
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: init
11+
image: alpine:3.14
12+
command:
13+
- /bin/sh
14+
- -xc
15+
- |
16+
sysctl fs.inotify.max_user_watches=1048576
17+
sysctl fs.inotify.max_user_instances=1024
18+
securityContext:
19+
privileged: true
20+
restartPolicy: Never
21+
backoffLimit: 1

hack/ci/run-e2e-tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ echo "Creating kind cluster $KIND_CLUSTER_NAME..."
6363
kind create cluster --name "$KIND_CLUSTER_NAME" --image kindest/node:v1.32.2
6464
chmod 600 "$KUBECONFIG"
6565

66+
# apply kernel limits job first and wait for completion
67+
echo "Applying kernel limits job…"
68+
kubectl apply --filename hack/ci/kernel.yaml
69+
kubectl wait --for=condition=Complete job/kernel-limits --timeout=300s
70+
echo "Kernel limits job completed."
71+
6672
# store logs as artifacts
6773
make protokol
6874
_tools/protokol --output "$ARTIFACTS/logs" --namespace 'kcp-*' --namespace 'e2e-*' >/dev/null 2>&1 &
@@ -109,6 +115,9 @@ WHAT="${WHAT:-./test/e2e/...}"
109115
TEST_ARGS="${TEST_ARGS:--timeout 2h -v}"
110116
E2E_PARALLELISM=${E2E_PARALLELISM:-2}
111117

118+
# Increase file descriptor limit for CI environments
119+
ulimit -n 65536
120+
112121
(set -x; go test -tags e2e -parallel $E2E_PARALLELISM $TEST_ARGS "$WHAT")
113122

114123
echo "Done. :-)"

hack/run-e2e-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ fi
5858

5959
echo "Kubeconfig is in $KUBECONFIG."
6060

61+
# apply kernel limits job first and wait for completion
62+
echo "Applying kernel limits job…"
63+
kubectl apply --filename hack/ci/kernel.yaml
64+
kubectl wait --for=condition=Complete job/kernel-limits --timeout=300s
65+
echo "Kernel limits job completed."
66+
6167
# deploying operator CRDs
6268
echo "Deploying operator CRDs..."
6369
kubectl apply --kustomize config/crd

0 commit comments

Comments
 (0)