chore(ci): Add 50ms simulated API latency (#10132)

In the real world, it's entirely possible that the latency between
clients, gateways, and relays is much lower than the latency to the API
nodes. This added latency will test that we can handle such cases
reliably.

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
Jamil
2025-08-05 12:23:43 -04:00
committed by GitHub
parent cacb44f7bb
commit a05067d410
2 changed files with 13 additions and 0 deletions

View File

@@ -146,6 +146,17 @@ jobs:
# Intended to mitigate <https://github.com/firezone/firezone/issues/5830>
sleep 3
- name: Add 50ms simulated API latency
run: |
docker compose exec -T -u root api sh -c 'apk add --no-cache iproute2-tc'
docker compose exec -T -u root api sh -c 'tc qdisc add dev eth0 root netem delay 50ms'
- name: Add 10ms simulated gateway latency
run: |
# compatibility test images won't have the `tc` command
docker compose exec -T gateway sh -c 'apk add --no-cache iproute2-tc'
docker compose exec -T gateway sh -c 'tc qdisc add dev eth0 root netem delay 10ms'
- run: ./scripts/tests/${{ matrix.test.name }}.sh
- name: Ensure Client emitted no warnings

View File

@@ -175,6 +175,8 @@ services:
FEATURE_IDP_SYNC_ENABLED: "true"
FEATURE_REST_API_ENABLED: "true"
FEATURE_INTERNET_RESOURCE_ENABLED: "true"
cap_add:
- NET_ADMIN # Needed to run `tc` commands to add simulated delay
depends_on:
vault:
condition: "service_healthy"