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
106dbc60
Commit
106dbc60
authored
Jul 07, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cff73a85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
go/neo/server/cluster_test.go
go/neo/server/cluster_test.go
+0
-9
go/xcommon/tracing/tracing.go
go/xcommon/tracing/tracing.go
+14
-1
go/xcommon/xtesting/xtesting.go
go/xcommon/xtesting/xtesting.go
+3
-1
No files found.
go/neo/server/cluster_test.go
View file @
106dbc60
...
...
@@ -141,15 +141,6 @@ func TestMasterStorage(t *testing.T) {
tracing
.
Unlock
()
/*
defer func() {
tracing.Lock()
defer tracing.Unlock()
tctx.Done()
}()
*/
// shortcut for addresses
xaddr
:=
func
(
addr
string
)
*
pipenet
.
Addr
{
a
,
err
:=
net
.
ParseAddr
(
addr
)
...
...
go/xcommon/tracing/tracing.go
View file @
106dbc60
...
...
@@ -132,7 +132,20 @@ XXX should tracing provide more tight integration with runtime/pprof.Profile?
Synchronous tracing
TODO
For testing purposes it is sometimes practical to leverage the property that
probes pause original code execution until the probe run is finished. That
means while the probe is running original goroutine
- is paused at well-defined point (where trace function is called), thus
- it cannot mutate any state it is programmed to mutate.
Using this properties it is possible to attach testing probes and verify that
a set of goroutines in tested code in question
- produce events in correct order, and
- at every event associated internal state is correct.
TODO example
Cross package tracing
...
...
go/xcommon/xtesting/xtesting.go
View file @
106dbc60
...
...
@@ -27,6 +27,8 @@ import (
"testing"
)
// XXX move -> tracing
// TODO tests for this
// XXX Tracer interface {Trace1} ?
...
...
@@ -70,7 +72,7 @@ func (st *SyncTracer) Get1() *SyncTraceMsg {
// XXX naming -> SyncTraceChecker
// TraceChecker synchronously collects and checks tracing events from a SyncTracer
type
TraceChecker
struct
{
t
*
testing
.
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