Skip to content

Commit

Permalink
Apply interface changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sejongk committed Nov 25, 2023
1 parent 5c42e17 commit 3acd623
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions server/backend/database/memory/housekeeping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestHousekeeping(t *testing.T) {

userInfo, err := memdb.CreateUserInfo(ctx, "test", "test")
assert.NoError(t, err)
project, err := memdb.CreateProjectInfo(ctx, database.DefaultProjectName, userInfo.ID, clientDeactivateThreshold)
project, err := memdb.CreateProjectInfo(ctx, database.DefaultProjectName, userInfo.Username, clientDeactivateThreshold)
assert.NoError(t, err)

yesterday := gotime.Now().Add(-24 * gotime.Hour)
Expand Down Expand Up @@ -123,7 +123,7 @@ func createDBandProjects(t *testing.T) (*memory.DB, []*database.ProjectInfo) {

projects := make([]*database.ProjectInfo, 0)
for i := 0; i < 10; i++ {
p, err := memdb.CreateProjectInfo(ctx, fmt.Sprintf("%d project", i), userInfo.ID, clientDeactivateThreshold)
p, err := memdb.CreateProjectInfo(ctx, fmt.Sprintf("%d project", i), userInfo.Username, clientDeactivateThreshold)
assert.NoError(t, err)

projects = append(projects, p)
Expand Down
14 changes: 7 additions & 7 deletions test/bench/push_pull_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func setUpClientsAndDocs(
assert.NoError(b, err)
docInfo, err := be.DB.FindDocInfoByKeyAndOwner(ctx, database.DefaultProjectID, clientInfo.ID, docKey, true)
assert.NoError(b, err)
assert.NoError(b, clientInfo.AttachDocument(docInfo.ID))
assert.NoError(b, clientInfo.AttachDocument(docInfo.Key, docInfo.ID))
assert.NoError(b, be.DB.UpdateClientInfoAfterPushPull(ctx, clientInfo, docInfo))

bytesID, _ := clientInfo.ID.Bytes()
Expand Down Expand Up @@ -136,7 +136,7 @@ func benchmarkPushChanges(
docKey := getDocKey(b, i)
clientInfos, docID, docs := setUpClientsAndDocs(ctx, 1, docKey, b, be)
pack := createChangePack(changeCnt, docs[0], b)
docInfo, err := documents.FindDocInfo(ctx, be, project, docID)
docInfo, err := documents.FindDocInfoByKeyAndID(ctx, be, docKey, docID)
assert.NoError(b, err)
b.StartTimer()

Expand All @@ -161,12 +161,12 @@ func benchmarkPullChanges(
pushPack := createChangePack(changeCnt, pusherDoc, b)
pullPack := createChangePack(0, pullerDoc, b)

docInfo, err := documents.FindDocInfo(ctx, be, project, docID)
docInfo, err := documents.FindDocInfoByKeyAndID(ctx, be, docKey, docID)
assert.NoError(b, err)
_, err = packs.PushPull(ctx, be, project, pusherClientInfo, docInfo, pushPack, types.SyncModePushPull)
assert.NoError(b, err)

docInfo, err = documents.FindDocInfo(ctx, be, project, docID)
docInfo, err = documents.FindDocInfoByKeyAndID(ctx, be, docKey, docID)
assert.NoError(b, err)
b.StartTimer()

Expand All @@ -192,7 +192,7 @@ func benchmarkPushSnapshots(
for j := 0; j < snapshotCnt; j++ {
b.StopTimer()
pushPack := createChangePack(changeCnt, docs[0], b)
docInfo, err := documents.FindDocInfo(ctx, be, project, docID)
docInfo, err := documents.FindDocInfoByKeyAndID(ctx, be, docKey, docID)
assert.NoError(b, err)
b.StartTimer()

Expand Down Expand Up @@ -226,12 +226,12 @@ func benchmarkPullSnapshot(
pushPack := createChangePack(changeCnt, pusherDoc, b)
pullPack := createChangePack(0, pullerDoc, b)

docInfo, err := documents.FindDocInfo(ctx, be, project, docID)
docInfo, err := documents.FindDocInfoByKeyAndID(ctx, be, docKey, docID)
assert.NoError(b, err)
_, err = packs.PushPull(ctx, be, project, pusherClientInfo, docInfo, pushPack, types.SyncModePushPull)
assert.NoError(b, err)

docInfo, err = documents.FindDocInfo(ctx, be, project, docID)
docInfo, err = documents.FindDocInfoByKeyAndID(ctx, be, docKey, docID)
assert.NoError(b, err)
b.StartTimer()

Expand Down

0 comments on commit 3acd623

Please sign in to comment.