Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Watch if Theia starts listening the port.
Browse files Browse the repository at this point in the history
Signed-off-by: Masaki Muranaka <monaka@monami-ya.com>
  • Loading branch information
monaka committed Jun 19, 2019
1 parent c209cd6 commit 5782188
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dockerfiles/theia/e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV NOCDN=true

RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
RUN apt-get update && \
apt-get install -y libx11-dev libxkbfile-dev sudo
apt-get install -y libx11-dev libxkbfile-dev sudo iproute2
CMD /root/docker-run.sh
RUN yarn global add typescript@2.9.2 node-gyp

Expand Down
23 changes: 21 additions & 2 deletions dockerfiles/theia/e2e/src/docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,32 @@
#
# SPDX-License-Identifier: EPL-2.0

# (5 + 2 * 30 = 65 seconds) is the default timeout.
: "${WAIT_COUNT:=30}"

echo "Starting Theia..."
rm -rf /root/logs/*
HOME=/home/theia /entrypoint.sh > /root/logs/theia.log 2>/root/logs/theia-error.log&
sleep 10s

echo "Cleaning videos folder..."
# Cleanup previous videos
rm -rf /root/cypress/videos
rm -rf /root/cypress/videos/*

# Find TCP 0.0.0.0:3100 that will be opened by Theia.
sleep 5s
while [ $WAIT_COUNT -gt 0 ]; do
# Check the listening port
ss -nlt | grep -Fq ':3100' && break
# not found
WAIT_COUNT=$((WAIT_COUNT-1));
echo "Waiting for booting up Theia..."
sleep 2s
done

if [ $WAIT_COUNT -eq 0 ]; then
echo "Timeout. Theia is dead?"
exit 1
fi

# Run tests
echo "Run the tests"
Expand Down

0 comments on commit 5782188

Please sign in to comment.