detached c5ad8c0

fix(benchmarks): report sqlite close errors

commit
c5ad8c0111ff59f5669d6df71cafbc0b11e5079e
author
brice · · 2026-07-14 14:16 UTC
parent
4d548f3
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +7 -2
M internal/infrastructure/persistence/sqlite/history_repo_benchmark_test.go +7 -2
@@ -22,6 +22,12 @@ func newHistoryBenchmarkRepository(b *testing.B) (repository.HistoryRepository,
2222 b.Fatal(err)
2323 }
2424
25+ b.Cleanup(func() {
26+ if err := db.Close(); err != nil {
27+ b.Errorf("close benchmark database: %v", err)
28+ }
29+ })
30+
2531 repo := sqlite.NewHistoryRepository(db)
2632 for i := range 200 {
2733 entry := &entity.HistoryEntry{
@@ -29,12 +35,11 @@ func newHistoryBenchmarkRepository(b *testing.B) (repository.HistoryRepository,
2935 Title: fmt.Sprintf("Dumber history entry %d", i),
3036 }
3137 if err := repo.Save(ctx, entry); err != nil {
32- _ = db.Close()
3338 b.Fatal(err)
3439 }
3540 }
3641
37- return repo, func() { _ = db.Close() }
42+ return repo, func() {}
3843 }
3944
4045 func BenchmarkHistorySQLiteSidebarRecent(b *testing.B) {
@@ -22,6 +22,12 @@ func newHistoryBenchmarkRepository(b *testing.B) (repository.HistoryRepository,
22 b.Fatal(err)22 b.Fatal(err)
23 }23 }
24 24
25+ b.Cleanup(func() {
26+ if err := db.Close(); err != nil {
27+ b.Errorf("close benchmark database: %v", err)
28+ }
29+ })
30+
25 repo := sqlite.NewHistoryRepository(db)31 repo := sqlite.NewHistoryRepository(db)
26 for i := range 200 {32 for i := range 200 {
27 entry := &entity.HistoryEntry{33 entry := &entity.HistoryEntry{
@@ -29,12 +35,11 @@ func newHistoryBenchmarkRepository(b *testing.B) (repository.HistoryRepository,
29 Title: fmt.Sprintf("Dumber history entry %d", i),35 Title: fmt.Sprintf("Dumber history entry %d", i),
30 }36 }
31 if err := repo.Save(ctx, entry); err != nil {37 if err := repo.Save(ctx, entry); err != nil {
32- _ = db.Close()
33 b.Fatal(err)38 b.Fatal(err)
34 }39 }
35 }40 }
36 41
37- return repo, func() { _ = db.Close() }42+ return repo, func() {}
38 }43 }
39 44
40 func BenchmarkHistorySQLiteSidebarRecent(b *testing.B) {45 func BenchmarkHistorySQLiteSidebarRecent(b *testing.B) {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close