Skip to content

Commit

Permalink
improve pipeline reliability
Browse files Browse the repository at this point in the history
Our list-databases test runs long and is bumping up against our timeout
and failing sometimes.
  • Loading branch information
fauna-chase committed Nov 7, 2023
1 parent f7d2777 commit ae496ff
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions concourse/scripts/wait-for-it.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
attempt_counter=0
max_attempts=100

echo "waiting for $1"
until $(curl -m 1 --output /dev/null --silent --head --fail $1); do
if [ ${attempt_counter} -eq ${max_attempts} ];then
echo ""
echo "Max attempts reached to $1"
exit 1
fi

echo "."
attempt_counter=$(($attempt_counter+1))
sleep 5
done
echo "$1 is up and running!"
8 changes: 7 additions & 1 deletion concourse/tasks/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ services:
volumes:
- "../../:/tmp/app"
working_dir: "/tmp/app"
command: [sh, -c, "yarn install && yarn run test"]
command:
- sh
- -cx
- |
apk add curl
concourse/scripts/wait-for-it.sh http://core:8443/ping
yarn install && yarn run test
1 change: 1 addition & 0 deletions test/commands/databases.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const databases = [

describe("database test", () => {
test
.timeout(7000)
.nock(getEndpoint(), { allowUnmocked: true }, (api) =>
api
.persist()
Expand Down

0 comments on commit ae496ff

Please sign in to comment.