Commit 32a37876 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Heptapod CI: avoid some concurrency problems

In the case where several jobs happen to run on the
same Docker host, it's important to avoid that they
use the same services. Otherwise, the first completion
breaks the ones still running, because it shuts down the
services they rely on.

Of course, it's better not to have such voracious jobs in
parallel, but that's a different issue.
parent 5ef966a4b664
......@@ -27,11 +27,6 @@ flake8:
.docker-remote:
stage: test-heptapod
services:
- name: octobus/heptapod:$TARGET_HEPTAPOD_IMAGE
alias: heptapod
- name: selenium/standalone-chrome
alias: selenium
# This base image provides in particular python3, Mercurial and SSH clients,
# as well as tox (Mercurial and hg-evolve have fixed versions, the same as
# server-side for the 'default' series of Heptapod.
......@@ -69,6 +64,13 @@ docker-inside:
docker-remote-0:
variables:
PYTEST_SHARD_ID: 0
services:
# unfortunately variables are not expanded in service aliases
# so we need to duplicate
- name: octobus/heptapod:$TARGET_HEPTAPOD_IMAGE
alias: heptapod-0
- name: selenium/standalone-chrome
alias: selenium-0
extends:
- .docker-remote
- .rules:test-heptapod
......@@ -76,6 +78,13 @@ docker-remote-0:
docker-remote-1:
variables:
PYTEST_SHARD_ID: 1
services:
# unfortunately variables are not expanded in service aliases
# so we need to duplicate
- name: octobus/heptapod:$TARGET_HEPTAPOD_IMAGE
alias: heptapod-1
- name: selenium/standalone-chrome
alias: selenium-1
extends:
- .docker-remote
- .rules:test-heptapod
......
......@@ -2,14 +2,18 @@
set -e
HEPTAPOD_SERVICE_IP=`getent ahostsv4 heptapod | grep STREAM | cut -f 1 -d ' '`
grep heptapod /etc/hosts
HEPTAPOD_SERVICE_IP=`getent ahostsv4 heptapod-$PYTEST_SHARD_ID | grep STREAM | cut -f 1 -d ' '`
echo "HEPTAPOD IP address is $HEPTAPOD_SERVICE_IP"
COMMON_FLAGS="-v \
--num-shards=$PYTEST_NUM_SHARDS \
--shard-id=$PYTEST_SHARD_ID \
--heptapod-url http://$HEPTAPOD_SERVICE_IP \
--heptapod-ssh-port 22 \
--heptapod-remote \
--heptapod-webdriver-remote-url http://selenium:4444/wd/hub"
--heptapod-webdriver-remote-url http://selenium-$PYTEST_SHARD_ID:4444/wd/hub"
if tox -- $COMMON_FLAGS --heptapod-wait-after-first-response 180; then
echo "First pass succeeded"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment