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
74905116
Commit
74905116
authored
Dec 23, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5b07254a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
go/internal/xtracing/tracetest/example_test.go
go/internal/xtracing/tracetest/example_test.go
+1
-1
go/internal/xtracing/tracetest/tracetest.go
go/internal/xtracing/tracetest/tracetest.go
+9
-3
No files found.
go/internal/xtracing/tracetest/example_test.go
View file @
74905116
...
...
@@ -106,7 +106,7 @@ func TestTracetestExample(t *testing.T) {
}()
// assert that events come as expected
t
.
Expect
(
"t2"
,
eventHello
(
"T
1
·C"
))
t
.
Expect
(
"t2"
,
eventHello
(
"T
2
·C"
))
t
.
Expect
(
"t1"
,
eventHi
(
"T1·A"
))
t
.
Expect
(
"t1"
,
eventHello
(
"T1·B"
))
...
...
go/internal/xtracing/tracetest/tracetest.go
View file @
74905116
...
...
@@ -523,12 +523,16 @@ func (t *T) SetEventRouter(routeEvent func(event interface{}) (stream string)) {
// XXX doc; naming
func
(
t
*
T
)
RxEvent
(
event
interface
{})
{
stream
:=
"default"
t
.
streamTabMu
.
Lock
()
ch
:=
t
.
chanForEvent
(
event
)
if
t
.
routeEvent
!=
nil
{
stream
=
t
.
routeEvent
(
event
)
}
ch
:=
t
.
chanForStream
(
stream
)
t
.
streamTabMu
.
Unlock
()
if
ch
==
nil
{
t
.
fatalfInNonMain
(
"
test failed"
)
t
.
fatalfInNonMain
(
"
%s: send: canceled (test failed)"
,
stream
)
}
// TODO it is possible to empirically detect here if a test incorrectly
...
...
@@ -563,6 +567,7 @@ func (t *T) RxEvent(event interface{}) {
ch
.
Send
(
event
)
}
/*
// chanForEvent returns channel corresponding to stream where event has to be delivered.
// must be called under streamTabMu.
func (t *T) chanForEvent(event interface{}) Chan {
...
...
@@ -572,6 +577,7 @@ func (t *T) chanForEvent(event interface{}) Chan {
}
return t.chanForStream(stream)
}
*/
// chanForStream returns channel corresponding to stream.
// must be called under streamTabMu.
...
...
@@ -790,7 +796,7 @@ func (t *T) FailNow() {
__
.
msg
.
nak
(
__
.
why
)
}
for
_
,
__
:=
range
sendv
{
__
.
msg
.
nak
(
"
test failed
"
)
// XXX reason can be custom / different
__
.
msg
.
nak
(
"
canceled (test failed)
"
)
// XXX reason can be custom / different
}
// in any case close channel where future Sends may arrive so that will "panic" too.
for
_
,
ch
:=
range
streamTab
{
...
...
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