mirror of
https://github.com/usememos/memos.git
synced 2025-01-30 17:11:13 +08:00
chore: upgrade version to 0.14.2
(#2035)
* chore: upgrade version to `0.14.2` * chore: remove TestConcurrentReadWrite test
This commit is contained in:
parent
d8d6de9fca
commit
8328b5dd4a
2 changed files with 2 additions and 48 deletions
|
@ -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" {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue