Skip to content

Db retries

Db retries #6

Workflow file for this run

name: Run Chaos Tests
on:
schedule:
# Runs every hour on the hour
- cron: '0 * * * *'
push:
branches:
- main
pull_request:
branches:
types:
- ready_for_review
- opened
- reopened
- synchronize
workflow_dispatch:
jobs:
chaos-test:
runs-on: ubuntu-latest
services:
# Postgres service container
postgres:
image: postgres:16
env:
# Specify the password for Postgres superuser.
POSTGRES_PASSWORD: a!b@c$d()e*_,/:;=?@ff[]22
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
fetch-tags: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x'
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Run chaos tests
run: go vet ./... && gotestsum --format github-action -- -v -count=1 -timeout=30m ./...
working-directory: ./chaos_tests
env:
PGPASSWORD: a!b@c$d()e*_,/:;=?@ff[]22
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Run Chaos Tests