Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.4"
cache: true
- run: go build ./...
- run: go vet ./...
- run: go test ./... -count=1 -race -coverprofile=coverage.out
- name: Coverage summary
run: go tool cover -func=coverage.out | tail -1
4 changes: 4 additions & 0 deletions internal/memory/durability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,13 @@ func TestCompactionDuringConcurrentUse(t *testing.T) {
s := open(t, Options{JournalPath: path, CompactAfter: 20})
const workers, rounds = 8, 120
var wg sync.WaitGroup
var compactWG sync.WaitGroup
var mu sync.Mutex
kept := 0
stop := make(chan struct{})
compactWG.Add(1)
go func() {
defer compactWG.Done()
for {
select {
case <-stop:
Expand Down Expand Up @@ -314,6 +317,7 @@ func TestCompactionDuringConcurrentUse(t *testing.T) {
}
wg.Wait()
close(stop)
compactWG.Wait() // join the compactor before Close so it cannot call Compact on a closed store
st := s.Stats()
if st.Memories != kept || st.Updates != workers*rounds || st.JournalErrors != 0 {
t.Fatalf("stats = %+v, want %d memories and %d updates", st, kept, workers*rounds)
Expand Down
Loading