This repository has been archived on 2022-07-30. You can view files and clone it, but cannot push or open issues/pull-requests.
mdb/database_test.go

24 lines
340 B
Go

package mdb
import (
"sync"
"testing"
)
func TestDatabase(t *testing.T) {
testWithDB(t, "multiple writers", func(t *testing.T, db *DB) {
wg := sync.WaitGroup{}
N := 64
wg.Add(64)
for i := 0; i < N; i++ {
go func() {
defer wg.Done()
for j := 0; j < 1024; j++ {
db.RandAction()
}
}()
}
wg.Wait()
})
}