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
6e1926c0
Commit
6e1926c0
authored
Dec 29, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4bcf4809
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
20 deletions
+18
-20
go/neo/neo_test.go
go/neo/neo_test.go
+6
-5
go/neo/t_cluster_test.go
go/neo/t_cluster_test.go
+12
-15
No files found.
go/neo/neo_test.go
View file @
6e1926c0
...
@@ -71,6 +71,8 @@ func tracetestMasterStorage(t0 *tracetest.T) {
...
@@ -71,6 +71,8 @@ func tracetestMasterStorage(t0 *tracetest.T) {
// ----------------------------------------
// ----------------------------------------
// XXX convert prologue to tStartSimpleNEOGoSrv (XXX naming)
// M starts listening
// M starts listening
tM
.
Expect
(
netlisten
(
"m:1"
))
tM
.
Expect
(
netlisten
(
"m:1"
))
tM
.
Expect
(
δnode
(
"m"
,
"m:1"
,
proto
.
MASTER
,
1
,
proto
.
RUNNING
,
proto
.
IdTimeNone
))
tM
.
Expect
(
δnode
(
"m"
,
"m:1"
,
proto
.
MASTER
,
1
,
proto
.
RUNNING
,
proto
.
IdTimeNone
))
...
@@ -425,11 +427,11 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker, benchit f
...
@@ -425,11 +427,11 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker, benchit f
t
:=
tStartSimpleNEOGoSrv
(
"abc1"
,
zback
)
t
:=
tStartSimpleNEOGoSrv
(
"abc1"
,
zback
)
defer
t
.
Stop
()
defer
t
.
Stop
()
/*
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
/*
wg := xsync.NewWorkGroup(ctx)
wg := xsync.NewWorkGroup(ctx)
defer wg.Wait()
defer wg.Wait()
defer cancel()
// spawn M
// spawn M
M := tNewMaster("abc1", "", Mnet)
M := tNewMaster("abc1", "", Mnet)
...
@@ -481,9 +483,8 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker, benchit f
...
@@ -481,9 +483,8 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker, benchit f
t
.
TraceOff
()
t
.
TraceOff
()
err
:=
M
.
Start
();
t
.
FatalIf
(
err
)
err
:=
M
.
Start
();
t
.
FatalIf
(
err
)
// if err != nil {
// b.Fatal(err)
C
:=
t
.
NewClient
(
"c"
,
"m:1"
)
// XXX better use M.Addr() ?
// }
xid1
:=
zodb
.
Xid
{
Oid
:
1
,
At
:
zodb
.
TidMax
}
xid1
:=
zodb
.
Xid
{
Oid
:
1
,
At
:
zodb
.
TidMax
}
...
...
go/neo/t_cluster_test.go
View file @
6e1926c0
...
@@ -300,30 +300,32 @@ func (m *tMaster) Run(ctx context.Context) error {
...
@@ -300,30 +300,32 @@ func (m *tMaster) Run(ctx context.Context) error {
// tStartSimpleNEOGoSrv starts simple NEO/go server with 1 master and 1 storage.
// tStartSimpleNEOGoSrv starts simple NEO/go server with 1 master and 1 storage.
// The cluster is returned in ready-to-start.
// The cluster is returned in ready-to-start.
func
tStartSimpleNEOGoSrv
(
name
string
,
Sback
storage
.
Backend
)
*
tCluster
{
//
t
:=
tNewCluster
(
name
)
// XXX naming -> tStartSimpleClusterMS ?
func
tStartSimpleNEOGoSrv
(
t0
*
tracetest
.
T
,
name
string
,
Sback
storage
.
Backend
)
*
tCluster
{
t
:=
tNewCluster
(
t0
,
name
)
M
:=
t
.
NewMaster
(
"m"
)
M
:=
t
.
NewMaster
(
"m"
)
// XXX if we would always use lonet or pipenet - all network addresses would be predictable
// XXX if we would always use lonet or pipenet - all network addresses would be predictable
// M starts listening
- determine its listen address
// M starts listening
t
.
Expect
(
"m"
,
netlisten
(
"
xxx"
))
// XXX xxx will be the address
t
.
Expect
(
"m"
,
netlisten
(
"
m:1"
))
t
.
Expect
(
"m"
,
δnode
(
"m"
,
Maddr
,
proto
.
MASTER
,
1
,
proto
.
RUNNING
,
proto
.
IdTimeNone
))
t
.
Expect
(
"m"
,
δnode
(
"m"
,
"m:1"
,
proto
.
MASTER
,
1
,
proto
.
RUNNING
,
proto
.
IdTimeNone
))
t
.
Expect
(
"m"
,
clusterState
(
"m"
,
proto
.
ClusterRecovering
))
t
.
Expect
(
"m"
,
clusterState
(
"m"
,
proto
.
ClusterRecovering
))
S
:=
t
.
NewStorage
(
"s"
,
Maddr
,
Sback
)
S
:=
t
.
NewStorage
(
"s"
,
"m:1"
,
Sback
)
// S starts listening
// S starts listening
t
.
Expect
(
"s"
,
netlisten
(
"
yyy"
))
// XXX yyy will be the address
t
.
Expect
(
"s"
,
netlisten
(
"
s:1"
))
// S connects to M
// S connects to M
t
.
Expect
(
"s-m"
,
netdial
(
"s"
,
Maddr
))
t
.
Expect
(
"s-m"
,
netdial
(
"s"
,
"m:1"
))
t
.
Expect
(
"s-m"
,
netconnect
(
"s
XXX"
,
"mYYY"
,
Maddr
))
t
.
Expect
(
"s-m"
,
netconnect
(
"s
:2"
,
"m:2"
,
"m:1"
))
t
.
Expect
(
"s-m"
,
conntx
(
"s:2"
,
"m:2"
,
1
,
&
proto
.
RequestIdentification
{
t
.
Expect
(
"s-m"
,
conntx
(
"s:2"
,
"m:2"
,
1
,
&
proto
.
RequestIdentification
{
NodeType
:
proto
.
STORAGE
,
NodeType
:
proto
.
STORAGE
,
UUID
:
0
,
UUID
:
0
,
Address
:
xnaddr
(
"s:1"
),
Address
:
xnaddr
(
"s:1"
),
ClusterName
:
"abc1"
,
ClusterName
:
name
,
IdTime
:
proto
.
IdTimeNone
,
IdTime
:
proto
.
IdTimeNone
,
DevPath
:
nil
,
DevPath
:
nil
,
NewNID
:
nil
,
NewNID
:
nil
,
...
@@ -356,10 +358,5 @@ func tStartSimpleNEOGoSrv(name string, Sback storage.Backend) *tCluster {
...
@@ -356,10 +358,5 @@ func tStartSimpleNEOGoSrv(name string, Sback storage.Backend) *tCluster {
// M ready to start: new cluster, no in-progress S recovery
// M ready to start: new cluster, no in-progress S recovery
t
.
Expect
(
"m"
,
masterStartReady
(
"m"
,
true
))
t
.
Expect
(
"m"
,
masterStartReady
(
"m"
,
true
))
err
:=
M
.
Start
()
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
return
t
return
t
}
}
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