Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
051cf040
Commit
051cf040
authored
Feb 20, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
1d807b7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+5
-5
No files found.
go/zodb/persistent_test.go
View file @
051cf040
...
...
@@ -192,6 +192,8 @@ func TestPersistentBasic(t *testing.T) {
}()
}
// ---- TestPersistentDB ----
// zcacheControl is simple live cache control that prevents specified objects
// to be evicted from live cache.
type
zcacheControl
struct
{
...
...
@@ -207,8 +209,6 @@ func (cc *zcacheControl) WantEvict(obj IPersistent) bool {
return
true
}
// ---- TestPersistentDB ----
// tPersistentDB represents one testing environment inside TestPersistentDB.
type
tPersistentDB
struct
{
*
testing
.
T
...
...
@@ -340,6 +340,7 @@ func TestPersistentDB(t0 *testing.T) {
stor
,
err
:=
OpenStorage
(
ctx
,
zurl
,
&
OpenOptions
{
ReadOnly
:
true
});
X
(
err
)
db
:=
NewDB
(
stor
)
// testopen opens new db transaction/connection and wraps it with tPersistentDB.
testopen
:=
func
(
opt
*
ConnOptions
)
*
tPersistentDB
{
t0
.
Helper
()
...
...
@@ -369,8 +370,6 @@ func TestPersistentDB(t0 *testing.T) {
// do not evict obj2 from live cache. obj1 is ok to be evicted.
zcache1
:=
t
.
conn
.
Cache
()
zcache1
.
SetControl
(
&
zcacheControl
{[]
Oid
{
_obj2
.
oid
}})
// FIXME test that live cache keeps objects live even if we drop all
// regular pointers to it and do GC.
// get objects
obj1
:=
t
.
Get
(
101
)
...
...
@@ -476,7 +475,8 @@ func TestPersistentDB(t0 *testing.T) {
t
.
checkObj
(
obj1
,
101
,
InvalidTid
,
GHOST
,
0
)
t
.
checkObj
(
obj2
,
102
,
at2
,
UPTODATE
,
0
,
"kitty"
)
// TODO live cache must not drop pinned entries after GC
// FIXME test that live cache keeps pinned object live even if we drop
// all regular pointers to it and do GC.
/*
obj1 = nil
obj2 = nil
...
...
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