Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: run nightly bank test #1816

Merged
merged 7 commits into from
Oct 14, 2022
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci-badger-bank-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ci-badger-bank-nightly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjust the names

on:
push:
branches:
- main
schedule:
- cron: "0 3 * * *"
jobs:
badger-bank:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Go Version
run: |
#!/bin/bash
GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GOVERSION }}
- name: Install Dependencies
run: make dependency
- name: Install jemalloc
run: make jemalloc
- name: Install Badger
run: cd badger && go install --race --tags=jemalloc .
- name: Run Badger Bank Test
run: |
#!/bin/bash -x
set -o pipefail
# get 16 random bytes from /dev/urandom
hexdump -vn16 -e'4/4 "%08X" 1 "\n"' /dev/urandom > badgerkey16bytes
badger bank test --dir=. --encryption-key "badgerkey16bytes" -d=4h 2>&1 | tee badgerbanktest.log | grep -v 'Moved $5'
if [ $? -ne 0 ]; then
if grep -qi 'data race' badgerbanktest.log; then
echo "Detected data race via grep..."
cat badgerbanktest.log | grep -v 'Moved $5'
else
echo "No data race detected via grep. Assuming txn violation..."
tail -1000 badgerbanktest.log
badger bank disect --dir=. --decryption-key "badgerkey16bytes"
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should move this block into the make file under make bank-test or something similar.

exit 1
fi
echo 'Bank test finished with no issues.'