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
bec06159
Commit
bec06159
authored
Dec 23, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2bfd4d5f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
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
+7
-13
No files found.
go/internal/xtracing/tracetest/example_test.go
View file @
bec06159
...
...
@@ -106,7 +106,7 @@ func TestTracetestExample(t *testing.T) {
}()
// assert that events come as expected
t
.
Expect
(
"t
3"
,
eventHi
(
"T2·C
"
))
t
.
Expect
(
"t
2"
,
eventHello
(
"T2·D
"
))
t
.
Expect
(
"t1"
,
eventHi
(
"T1·A"
))
t
.
Expect
(
"t1"
,
eventHello
(
"T1·B"
))
...
...
go/internal/xtracing/tracetest/tracetest.go
View file @
bec06159
...
...
@@ -92,8 +92,6 @@ import (
"time"
"github.com/kylelemons/godebug/pretty"
// "lab.nexedi.com/kirr/go123/xruntime"
)
var
(
...
...
@@ -622,7 +620,7 @@ func (t *T) expect1(stream string, eventExpect interface{}) *Msg {
if
!
reflect
.
DeepEqual
(
revent
.
Interface
(),
reventExpect
.
Interface
())
{
t
.
queuenak
(
msg
,
"unexpected event data"
)
t
.
Fatalf
(
"%s: expect: %s:
\n
want: %v
\n
have: %v
\n
diff:
\n
%s
\n
"
,
t
.
Fatalf
(
"%s: expect: %s:
\n
want: %v
\n
have: %v
\n
diff:
\n
%s
\n
\n
"
,
stream
,
reventExpect
.
Type
(),
reventExpect
,
revent
,
pretty
.
Compare
(
reventExpect
.
Interface
(),
revent
.
Interface
()))
...
...
@@ -759,6 +757,7 @@ func (t *T) FailNow() {
t
.
streamTab
=
nil
t
.
streamTabMu
.
Unlock
()
// print details about pending events and all streams
type
sendInfo
struct
{
ch
Chan
;
msg
*
Msg
}
var
sendv
[]
sendInfo
// sends are pending here
var
quietv
[]
Chan
// this channels are quiet
...
...
@@ -783,23 +782,18 @@ func (t *T) FailNow() {
}
}
bad
:=
""
if
len
(
sendv
)
==
0
{
bad
+=
fmt
.
Sprintf
(
"no pending events
\n
"
)
}
else
{
bad
+=
fmt
.
Sprintf
(
"%d pending event(s):
\n
"
,
len
(
sendv
))
pending
:=
fmt
.
Sprintf
(
"#streams: %d, #(pending events): %d
\n
"
,
len
(
streams
),
len
(
sendv
))
for
_
,
__
:=
range
sendv
{
bad
+=
fmt
.
Sprintf
(
"%s
\t
<- %T %v
\n
"
,
__
.
ch
.
name
(),
__
.
msg
.
Event
,
__
.
msg
.
Event
)
}
pending
+=
fmt
.
Sprintf
(
"%s
\t
<- %T %v
\n
"
,
__
.
ch
.
name
(),
__
.
msg
.
Event
,
__
.
msg
.
Event
)
}
for
_
,
ch
:=
range
quietv
{
bad
+=
fmt
.
Sprintf
(
"# %s
\n
"
,
ch
.
name
())
pending
+=
fmt
.
Sprintf
(
"# %s
\n
"
,
ch
.
name
())
}
// log the details and nak senders that we received from.
// nak them only after details printout, so that our text comes first,
// and their "panics" don't get intermixed with it.
t
.
Log
(
bad
)
t
.
Log
(
pending
)
for
_
,
__
:=
range
t
.
nakq
{
__
.
msg
.
nak
(
__
.
why
)
}
...
...
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