From a05067d410b7d9c78cab57ed468d032fe351967d Mon Sep 17 00:00:00 2001 From: Jamil Date: Tue, 5 Aug 2025 12:23:43 -0400 Subject: [PATCH] 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 --- .github/workflows/_integration_tests.yml | 11 +++++++++++ docker-compose.yml | 2 ++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/_integration_tests.yml b/.github/workflows/_integration_tests.yml index 2c97228ff..4e3f3cc3e 100644 --- a/.github/workflows/_integration_tests.yml +++ b/.github/workflows/_integration_tests.yml @@ -146,6 +146,17 @@ jobs: # Intended to mitigate 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 diff --git a/docker-compose.yml b/docker-compose.yml index 3cfc7e3c9..3c710f3c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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"