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
b5bfc158
Commit
b5bfc158
authored
Dec 30, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6b817f16
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
go/neo/neo_test.go
go/neo/neo_test.go
+0
-4
go/neo/t_cluster_test.go
go/neo/t_cluster_test.go
+13
-1
No files found.
go/neo/neo_test.go
View file @
b5bfc158
...
...
@@ -354,18 +354,14 @@ func benchmarkGetObject(b *testing.B, Mnet, Snet, Cnet xnet.Networker, benchit f
X
:=
exc
.
Raiseif
tracetest
.
Run
(
b
,
func
(
t0
*
tracetest
.
T
)
{
println
(
"AAA"
)
// create test cluster
zback
:=
xfs1back
(
"../zodb/storage/fs1/testdata/1.fs"
)
t
:=
tNewCluster_MS
(
t0
,
"abc1"
,
zback
)
defer
t
.
Stop
()
M
:=
t
.
Master
(
"m"
)
println
(
"BBB"
)
t
.
TraceOff
()
println
(
"CCC"
)
err
:=
M
.
Start
();
X
(
err
)
println
(
"DDD"
)
C
:=
t
.
NewClient
(
"c"
,
"m:1"
)
...
...
go/neo/t_cluster_test.go
View file @
b5bfc158
...
...
@@ -53,6 +53,7 @@ type tCluster struct {
name
string
// name of the cluster
network
*
virtnet
.
SubNetwork
// nodes interoperate via network
traceOn
bool
// whether tracing is currently on or off
gotracer
*
TraceCollector
// for tracing go nodes XXX -> GoTracer
//tpy *PyTracer // for tracing py nodes
erouter
*
EventRouter
// to which stream an event should go
...
...
@@ -69,7 +70,7 @@ type tCluster struct {
// tNode represents information about a tested node.
type
tNode
struct
{
itest
interface
{}
// ITest{Master,Storage,Client}
net
xnet
.
Network
er
net
*
xnet
.
Trac
er
}
// ITestMaster represents tested master node.
...
...
@@ -104,6 +105,7 @@ func tNewCluster(ttest *tracetest.T, name string) *tCluster {
t
.
network
=
pipenet
.
AsVirtNet
(
pipenet
.
New
(
"testnet"
))
t
.
traceOn
=
true
t
.
erouter
=
NewEventRouter
()
t
.
gotracer
=
NewTraceCollector
(
ttest
)
ttest
.
SetEventRouter
(
t
.
erouter
.
RouteEvent
)
...
...
@@ -140,8 +142,15 @@ func (t *tCluster) Stop() {
// TraceOff disables tracing.
// Trace events will stop to be created and delivered.
func
(
t
*
tCluster
)
TraceOff
()
{
t
.
traceOn
=
false
t
.
gotracer
.
Detach
()
//XXX t.pytracer.Detach()
t
.
tabMu
.
Lock
()
defer
t
.
tabMu
.
Unlock
()
for
_
,
tnode
:=
range
t
.
nodeTab
{
tnode
.
net
.
TraceOff
()
}
}
// Checker returns tracechecker corresponding to name.
...
...
@@ -208,6 +217,9 @@ func (t *tCluster) registerNewNode(name string) *tNode {
node
:=
&
tNode
{}
node
.
net
=
xnet
.
NetTrace
(
host
,
t
.
gotracer
)
if
!
t
.
traceOn
{
node
.
net
.
TraceOff
()
}
t
.
nodeTab
[
name
]
=
node
return
node
...
...
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