chore: upgrade version to 0.14.2 (#2035)

* chore: upgrade version to `0.14.2`

* chore: remove TestConcurrentReadWrite test
This commit is contained in:
boojack 2023-07-26 22:42:38 +08:00 committed by GitHub
parent d8d6de9fca
commit 8328b5dd4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 48 deletions

View file

@ -9,10 +9,10 @@ import (
// Version is the service current released version.
// Semantic versioning: https://semver.org/
var Version = "0.14.1"
var Version = "0.14.2"
// DevVersion is the service current development version.
var DevVersion = "0.14.1"
var DevVersion = "0.14.2"
func GetCurrentVersion(mode string) string {
if mode == "dev" || mode == "demo" {

View file

@ -1,47 +1 @@
package teststore
import (
"context"
"fmt"
"sync"
"testing"
"github.com/stretchr/testify/require"
"github.com/usememos/memos/store"
)
func TestConcurrentReadWrite(t *testing.T) {
ctx := context.Background()
ts := NewTestingStore(ctx, t)
user, err := createTestingHostUser(ctx, ts)
require.NoError(t, err)
const numWorkers = 10
const numIterations = 100
wg := sync.WaitGroup{}
wg.Add(numWorkers)
for i := 0; i < numWorkers; i++ {
go func() {
for j := 0; j < numIterations; j++ {
_, err := ts.CreateMemo(ctx, &store.Memo{
CreatorID: user.ID,
Content: fmt.Sprintf("test_content_%d", i),
Visibility: store.Public,
})
require.NoError(t, err)
}
}()
go func() {
_, err := ts.ListMemos(ctx, &store.FindMemo{
CreatorID: &user.ID,
})
require.NoError(t, err)
wg.Done()
}()
}
wg.Wait()
}