Skip to content

Commit

Permalink
Add long processing test (#89)
Browse files Browse the repository at this point in the history
This adds a new test case where the receiver has a delay (simulating
processing) between 10 and 550 seconds

First commit is the test addition, second one generates the resources

---------

Signed-off-by: Pierangelo Di Pilato <[email protected]>
  • Loading branch information
pierDipi authored Oct 24, 2024
1 parent 331072f commit 0decfaf
Show file tree
Hide file tree
Showing 224 changed files with 24,895 additions and 1 deletion.
11 changes: 11 additions & 0 deletions bin/generate-test-cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ rm -rf tests/broker/kafka
--payload-file payloads/payload.36KB.txt \
--delivery-order unordered

./bin/kafka_broker_generator.py \
--num-brokers 20 \
--num-triggers 10 \
--resources-output-dir tests/broker/kafka/p10-r3-unord-b20-t10-32kb-lp/resources \
--hf-output-dir tests/broker/kafka/p10-r3-unord-b20-t10-32kb-lp \
--name-prefix p10-r3-unord-b20-t10-32kb-lp \
--payload-file payloads/payload.36KB.txt \
--delivery-order unordered \
--receiver-fault-min-sleep-duration 10s \
--receiver-fault-max-sleep-duration 550s

./bin/kafka_broker_generator.py \
--num-brokers 10 \
--num-triggers 10 \
Expand Down
13 changes: 12 additions & 1 deletion bin/kafka_broker_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
dest='steady_state_duration', help='steady_state_duration in sec')
parser.add_argument('--max-iterations', type=int, default=5,
dest='max_iterations', help='max_iterations')
parser.add_argument('--receiver-fault-min-sleep-duration', type=str, default='',
dest='receiver_fault_min_sleep_duration', help='receiver_fault_min_sleep_duration')
parser.add_argument('--receiver-fault-max-sleep-duration', type=str, default='',
dest='receiver_fault_max_sleep_duration', help='receiver_fault_max_sleep_duration')
args = parser.parse_args()

triggers = []
Expand Down Expand Up @@ -90,6 +94,13 @@
for t_idx in range(args.num_triggers):
trigger_name = f"{broker_name}-trigger-{t_idx}"
triggers.append(trigger_name)
fault = ""
if args.receiver_fault_max_sleep_duration != '' and args.receiver_fault_min_sleep_duration != '':
fault = f"""
fault:
minSleepDuration: {args.receiver_fault_min_sleep_duration}
maxSleepDuration: {args.receiver_fault_max_sleep_duration}"""

trigger_manifests = f"""
---
apiVersion: eventing.knative.dev/v1
Expand Down Expand Up @@ -139,7 +150,7 @@
receiver:
port: 8080
timeout: 5m
maxDuplicatesPercentage: 1
maxDuplicatesPercentage: 1{fault}
duration: 10m
timeout: 1m
Expand Down
7 changes: 7 additions & 0 deletions tests/broker/kafka/p10-r3-unord-b20-t10-32kb-lp/additional.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


HTTP_TARGET=$(oc get brokers.eventing.knative.dev -n "${TEST_CASE_NAMESPACE}" p10-r3-unord-b20-t10-32kb-lp-0 -o jsonpath='{.status.address.url}') || exit 1
BENCHMARK_NAME=eventing-staircase

export HTTP_TARGET BENCHMARK_NAME

485 changes: 485 additions & 0 deletions tests/broker/kafka/p10-r3-unord-b20-t10-32kb-lp/hf.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@

---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-0-trigger-0
annotations:
kafka.eventing.knative.dev/delivery.order: unordered
spec:
broker: p10-r3-unord-b20-t10-32kb-lp-0
subscriber:
ref:
apiVersion: v1
kind: Service
name: p10-r3-unord-b20-t10-32kb-lp-svc
uri: "/p10-r3-unord-b20-t10-32kb-lp-0-trigger-0"
---
apiVersion: v1
kind: Service
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-svc
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
type: ClusterIP
selector:
app: p10-r3-unord-b20-t10-32kb-lp-svc
ports:
- port: 80
protocol: TCP
targetPort: receiver
name: http
- port: 9090
protocol: TCP
targetPort: http-metrics
name: http-metrics

---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-sacura
data:
sacura.yaml: |
sender:
disabled: true
receiver:
port: 8080
timeout: 5m
maxDuplicatesPercentage: 1
fault:
minSleepDuration: 10s
maxSleepDuration: 550s
duration: 10m
timeout: 1m
---

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-svc
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
endpoints:
- path: /metrics
port: http-metrics
selector:
matchLabels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
---

apiVersion: apps/v1
kind: Deployment
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-svc
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
selector:
matchLabels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
template:
metadata:
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
containers:
- name: receiver
image: ghcr.io/pierdipi/sacura/sacura-7befbbbc92911c6727467cfbf23af88f
args:
- "--config"
- "/etc/sacura/sacura.yaml"
imagePullPolicy: Always
resources:
requests:
memory: "1Gi"
cpu: "1"
volumeMounts:
- mountPath: /etc/sacura
name: config
ports:
- containerPort: 8080
protocol: TCP
name: receiver
- containerPort: 9090
protocol: TCP
name: http-metrics
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: "service=p10-r3-unord-b20-t10-32kb-lp-svc"
- name: OTEL_SERVICE_NAME
value: "sacura"
volumes:
- name: config
configMap:
name: config-sacura

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@

---
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-0-trigger-1
annotations:
kafka.eventing.knative.dev/delivery.order: unordered
spec:
broker: p10-r3-unord-b20-t10-32kb-lp-0
subscriber:
ref:
apiVersion: v1
kind: Service
name: p10-r3-unord-b20-t10-32kb-lp-svc
uri: "/p10-r3-unord-b20-t10-32kb-lp-0-trigger-1"
---
apiVersion: v1
kind: Service
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-svc
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
type: ClusterIP
selector:
app: p10-r3-unord-b20-t10-32kb-lp-svc
ports:
- port: 80
protocol: TCP
targetPort: receiver
name: http
- port: 9090
protocol: TCP
targetPort: http-metrics
name: http-metrics

---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-sacura
data:
sacura.yaml: |
sender:
disabled: true
receiver:
port: 8080
timeout: 5m
maxDuplicatesPercentage: 1
fault:
minSleepDuration: 10s
maxSleepDuration: 550s
duration: 10m
timeout: 1m
---

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-svc
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
endpoints:
- path: /metrics
port: http-metrics
selector:
matchLabels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
---

apiVersion: apps/v1
kind: Deployment
metadata:
name: p10-r3-unord-b20-t10-32kb-lp-svc
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
selector:
matchLabels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
template:
metadata:
labels:
app: p10-r3-unord-b20-t10-32kb-lp-svc
spec:
containers:
- name: receiver
image: ghcr.io/pierdipi/sacura/sacura-7befbbbc92911c6727467cfbf23af88f
args:
- "--config"
- "/etc/sacura/sacura.yaml"
imagePullPolicy: Always
resources:
requests:
memory: "1Gi"
cpu: "1"
volumeMounts:
- mountPath: /etc/sacura
name: config
ports:
- containerPort: 8080
protocol: TCP
name: receiver
- containerPort: 9090
protocol: TCP
name: http-metrics
env:
- name: OTEL_RESOURCE_ATTRIBUTES
value: "service=p10-r3-unord-b20-t10-32kb-lp-svc"
- name: OTEL_SERVICE_NAME
value: "sacura"
volumes:
- name: config
configMap:
name: config-sacura

Loading

0 comments on commit 0decfaf

Please sign in to comment.