Commit b5bfc158 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6b817f16
......@@ -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")
......
......@@ -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.Networker
net *xnet.Tracer
}
// 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment