Skip to content

Commit 920a0b9

Browse files
authored
Fix pair_aggregator idempotency check (#1127)
We need parentheses around the right hand side of the `||` so that everything get skipped if `/tmp/done` exists. Also tests in CI that bringing the deployment up, down and up again works. Part of #1096
1 parent 152f352 commit 920a0b9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/docker.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ jobs:
4040
RUST_FEATURES=${{ steps.resolve_variables.outputs.RUST_FEATURES }}
4141
# Test the dev compose, which should use the images built earlier. Technically this is only
4242
# interesting when feature integration-testing is on, but we may as well exercise both.
43+
#
44+
# Bring the environment up, down and up again to ensure all services can restart
4345
- name: Compose (dev)
4446
id: compose-dev
45-
run: docker compose -f compose.dev.yaml up --wait --wait-timeout 120
47+
run: |
48+
docker compose -f compose.dev.yaml up --wait --wait-timeout 120
49+
docker compose down
50+
docker compose -f compose.dev.yaml up --wait --wait-timeout 120
4651
- name: Inspect dev containers
4752
if: ${{ failure() && steps.compose-dev.outcome != 'success' }}
4853
run: |

compose.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ services:
9090
- -c
9191
- |
9292
test -f /tmp/done || \
93-
/divviup --url=http://localhost:8080 --token="" \
93+
(/divviup --url=http://localhost:8080 --token="" \
9494
aggregator create \
9595
--name=leader --api-url=http://janus_1_aggregator:8080/aggregator-api \
9696
--bearer-token=0000 \
@@ -101,7 +101,7 @@ services:
101101
aggregator create \
102102
--name=helper --api-url=http://janus_2_aggregator:8080/aggregator-api \
103103
--bearer-token=0000 && \
104-
touch /tmp/done
104+
touch /tmp/done)
105105
network_mode: service:divviup_api
106106
depends_on:
107107
divviup_api:

0 commit comments

Comments
 (0)