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
503c430b
Commit
503c430b
authored
Feb 23, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3610f045
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
t/neo/connection_test.go
t/neo/connection_test.go
+6
-0
t/neo/storage/fs1/filestorage_test.go
t/neo/storage/fs1/filestorage_test.go
+7
-7
No files found.
t/neo/connection_test.go
View file @
503c430b
...
...
@@ -123,6 +123,12 @@ func xverifyPkt(pkt *PktBuf, connid uint32, msgcode uint16, payload []byte) {
// delay a bit
// needed e.g. to test Close interaction with waiting read or write
// (we cannot easily sync and make sure e.g. read is started and became asleep)
//
// XXX JM suggested to really wait till syscall starts this way:
// - via polling get traceback for thread that is going to call syscall and eventuall block
// - if from that traceback we can see that blocking syscall is already called
// -> this way we can know that it is already blocking and thus sleep-hack can be avoided
// this can be done via runtime/pprof -> "goroutine" predefined profile
func
tdelay
()
{
time
.
Sleep
(
1
*
time
.
Millisecond
)
}
...
...
t/neo/storage/fs1/filestorage_test.go
View file @
503c430b
...
...
@@ -4,7 +4,6 @@ package fs1
import
(
"bytes"
"strconv"
"testing"
"../../zodb"
...
...
@@ -12,13 +11,13 @@ import (
// one entry inside transaction
type
txnEntry
struct
{
Header
DataHeader
rawData
[]
byte
// what is on disk, e.g. it can be backpointer
data
[]
byte
// data client should see on load; nil means same as RawData
Header
DataHeader
rawData
[]
byte
// what is on disk, e.g. it can be backpointer
userData
[]
byte
// data client should see on load; nil means same as RawData
}
func
(
txe
*
txnEntry
)
Data
()
[]
byte
{
data
:=
txe
.
d
ata
data
:=
txe
.
userD
ata
if
data
==
nil
{
data
=
txe
.
rawData
}
...
...
@@ -40,7 +39,8 @@ func TestLoad(t *testing.T) {
for
_
,
txe
:=
range
dbe
.
Entryv
{
txh
:=
txe
.
Header
xid
:=
zodb
.
Xid
{
zodb
.
XTid
{
txh
.
Tid
,
false
},
txh
.
Oid
}
// loadSerial
// loadSerial
xid
:=
zodb
.
Xid
{
zodb
.
XTid
{
txh
.
Tid
,
false
},
txh
.
Oid
}
data
,
tid
,
err
:=
fs
.
Load
(
xid
)
if
err
!=
nil
{
t
.
Errorf
(
"load %v: %v"
,
xid
,
err
)
...
...
@@ -49,7 +49,7 @@ func TestLoad(t *testing.T) {
t
.
Errorf
(
"load %v: returned tid unexpected: %v"
,
xid
,
tid
)
}
if
!
bytes
.
Equal
(
data
,
txe
.
Data
())
{
t
.
Errorf
(
"load %v: different data:
\n
have: %
s
\n
want: %s"
,
xid
,
strconv
.
Quote
(
string
(
data
)),
strconv
.
Quote
(
string
(
txe
.
Data
())
))
t
.
Errorf
(
"load %v: different data:
\n
have: %
q
\n
want: %q"
,
xid
,
data
,
txe
.
Data
(
))
}
}
}
...
...
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