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
1
Merge Requests
1
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
503c430b
Commit
503c430b
authored
8 years ago
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3610f045
Changes
2
Show 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
)
}
...
...
This diff is collapsed.
Click to expand it.
t/neo/storage/fs1/filestorage_test.go
View file @
503c430b
...
...
@@ -4,7 +4,6 @@ package fs1
import
(
"bytes"
"strconv"
"testing"
"../../zodb"
...
...
@@ -14,11 +13,11 @@ import (
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
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
(
))
}
}
}
...
...
This diff is collapsed.
Click to expand it.
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