Skip to content

Commit

Permalink
ci: add chaos testing
Browse files Browse the repository at this point in the history
  • Loading branch information
polRk committed Oct 28, 2024
1 parent 17a901b commit fb6de19
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
22 changes: 22 additions & 0 deletions .github/scripts/run-chaos-testing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
curl -L https://github.com/alexei-led/pumba/releases/download/0.10.1/pumba_linux_amd64 -o /tmp/pumba
chmod +x /tmp/pumba


timeout 3m /tmp/pumba --random --interval 30s \
restart --timeout 30s \
re2:^ydb-dynamic &

/tmp/pumba --random \
netem --duration 1m --interface lo --tc-image gaiadocker/iproute2 \
delay --time 900 --jitter 300 --correlation 20 \
re2:^ydb-dynamic

/tmp/pumba --random \
netem --duration 1m --interface lo --tc-image gaiadocker/iproute2 \
loss --percent 20 \
re2:^ydb-dynamic

/tmp/pumba --random \
netem --duration 1m --interface lo --tc-image gaiadocker/iproute2 \
corrupt --percent 20 \
re2:^ydb-dynamic
27 changes: 20 additions & 7 deletions .github/workflows/slo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ jobs:
label: xorm

concurrency:
group: slo-${{ github.ref }}-${{matrix.sdk.name}}
group: slo-${{ github.ref }}-${{ matrix.sdk.name }}
cancel-in-progress: true

steps:
- name: Checkout repository
Expand All @@ -79,16 +80,28 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
sdk_name: ${{ matrix.sdk.name }}

- name: Prepare SLO Database
run: |
timeout 10 ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 create grpc://localhost:2135 /Root/testdb
- name: Run chaos testing
run: |
echo 'Performing chaos testing...'
bash ./.github/scripts/run-chaos-testing.sh &
- name: Run SLO Tests
timeout-minutes: 11
run: |
./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 create grpc://localhost:2135 /Root/testdb
./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 run grpc://localhost:2135 /Root/testdb \
timeout 200 ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 run grpc://localhost:2135 /Root/testdb \
-prom-pgw localhost:9091 \
-report-period 250 \
-time ${{inputs.slo_workload_duration_seconds || 600}} \
-time ${{inputs.slo_workload_duration_seconds || 200}} \
-read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \
-write-rps ${{inputs.slo_workload_write_max_rps || 100}} \
-read-timeout 10000 \
-write-timeout 10000 \
-shutdown-time 30
./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb
-write-timeout 10000
- name: Cleanup SLO Database
continue-on-error: true
run: |
timeout 10 ./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb

0 comments on commit fb6de19

Please sign in to comment.