Skip to content

Commit

Permalink
Fix list benchmark and notify CI on error (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
marco6 authored Aug 30, 2024
1 parent e116576 commit 4ff33f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ jobs:
- name: Run benchmarks
id: bench
run: |
set -o pipefail
go test \
-timeout 1h \
-tags libsqlite3 -v -p 1 ./... \
-benchmem -count $BENCH_COUNT \
-run "^$$" -bench . \
Expand All @@ -118,9 +120,11 @@ jobs:
- name: Run benchmark for base code
if: steps.bench-cache.outputs.cache-hit != 'true'
run: |
set -o pipefail
git fetch origin $BASE_BRANCH
git reset --hard $BASE_SHA
go test \
-timeout 1h \
-tags libsqlite3 -v -p 1 ./... \
-benchmem -count $BENCH_COUNT \
-run "^$$" -bench . \
Expand Down
6 changes: 3 additions & 3 deletions test/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ func TestList(t *testing.T) {

func BenchmarkList(b *testing.B) {
setup := func(ctx context.Context, tx *sql.Tx, payloadSize, n int) error {
if err := insertMany(ctx, tx, "key", payloadSize, n*2); err != nil {
if err := insertMany(ctx, tx, "key", payloadSize, n); err != nil {
return err
}
if err := updateMany(ctx, tx, "key", payloadSize, n); err != nil {
if err := updateMany(ctx, tx, "key", payloadSize, n/2); err != nil {
return err
}
if err := deleteMany(ctx, tx, "key", n); err != nil {
if err := deleteMany(ctx, tx, "key", n/2); err != nil {
return err
}
return nil
Expand Down

0 comments on commit 4ff33f7

Please sign in to comment.