Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
c68c0994
Commit
c68c0994
authored
May 24, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/zodb: tests: Teach tDB.Commit to return committed TID
And use that in the callers.
parent
1d9bbb0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+6
-9
No files found.
go/zodb/persistent_test.go
View file @
c68c0994
...
@@ -317,7 +317,7 @@ func (t *tDB) Add(oid Oid, value string) {
...
@@ -317,7 +317,7 @@ func (t *tDB) Add(oid Oid, value string) {
}
}
// Commit commits objects queued by Add.
// Commit commits objects queued by Add.
func
(
t
*
tDB
)
Commit
()
{
func
(
t
*
tDB
)
Commit
()
Tid
{
t
.
Helper
()
t
.
Helper
()
head
,
err
:=
ZPyCommit
(
t
.
zurl
,
t
.
head
,
t
.
commitq
...
)
head
,
err
:=
ZPyCommit
(
t
.
zurl
,
t
.
head
,
t
.
commitq
...
)
...
@@ -326,6 +326,7 @@ func (t *tDB) Commit() {
...
@@ -326,6 +326,7 @@ func (t *tDB) Commit() {
}
}
t
.
head
=
head
t
.
head
=
head
t
.
commitq
=
nil
t
.
commitq
=
nil
return
head
}
}
// Open opens new test transaction/connection.
// Open opens new test transaction/connection.
...
@@ -473,13 +474,11 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
...
@@ -473,13 +474,11 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
tdb
.
Add
(
101
,
"bonjour"
)
tdb
.
Add
(
101
,
"bonjour"
)
tdb
.
Add
(
102
,
"monde"
)
tdb
.
Add
(
102
,
"monde"
)
tdb
.
Commit
()
at0
:=
tdb
.
Commit
()
at0
:=
tdb
.
head
tdb
.
Add
(
101
,
"hello"
)
tdb
.
Add
(
101
,
"hello"
)
tdb
.
Add
(
102
,
"world"
)
tdb
.
Add
(
102
,
"world"
)
tdb
.
Commit
()
at1
:=
tdb
.
Commit
()
at1
:=
tdb
.
head
tdb
.
Reopen
()
// so that at0 is not covered by db.δtail
tdb
.
Reopen
()
// so that at0 is not covered by db.δtail
db
:=
tdb
.
db
db
:=
tdb
.
db
...
@@ -541,8 +540,7 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
...
@@ -541,8 +540,7 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
// commit change to obj2 from external process
// commit change to obj2 from external process
tdb
.
Add
(
102
,
"kitty"
)
tdb
.
Add
(
102
,
"kitty"
)
tdb
.
Commit
()
at2
:=
tdb
.
Commit
()
at2
:=
tdb
.
head
// new db connection should see the change
// new db connection should see the change
t2
:=
tdb
.
Open
(
&
ConnOptions
{})
t2
:=
tdb
.
Open
(
&
ConnOptions
{})
...
@@ -730,8 +728,7 @@ func TestLiveCache(t0 *testing.T) {
...
@@ -730,8 +728,7 @@ func TestLiveCache(t0 *testing.T) {
tdb
.
Add
(
102
,
"труд"
)
tdb
.
Add
(
102
,
"труд"
)
tdb
.
Add
(
103
,
"май"
)
tdb
.
Add
(
103
,
"май"
)
tdb
.
Add
(
104
,
"весна"
)
tdb
.
Add
(
104
,
"весна"
)
tdb
.
Commit
()
at1
:=
tdb
.
Commit
()
at1
:=
tdb
.
head
zcc
:=
&
zcacheControl
{
map
[
Oid
]
PCachePolicy
{
zcc
:=
&
zcacheControl
{
map
[
Oid
]
PCachePolicy
{
// obj1 - default (currently: don't pin and don't keep state)
// obj1 - default (currently: don't pin and don't keep state)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment