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
7394278b
Commit
7394278b
authored
Dec 24, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b2cec010
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
19 deletions
+4
-19
go/internal/xtracing/tracetest/example_test.go
go/internal/xtracing/tracetest/example_test.go
+4
-19
No files found.
go/internal/xtracing/tracetest/example_test.go
View file @
7394278b
...
...
@@ -130,21 +130,15 @@ func Test2ThreadsOK(t *testing.T) {
}()
// assert that events come as expected
// in checks t2 vs t1 order does not matter
//
NOTE
in checks t2 vs t1 order does not matter
t
.
Expect
(
"t2"
,
eventHello
(
"T2·C"
))
t
.
Expect
(
"t2"
,
eventHi
(
"T2·D"
))
t
.
Expect
(
"t1"
,
eventHi
(
"T1·A"
))
t
.
Expect
(
"t1"
,
eventHello
(
"T1·B"
))
// XXX also t.Recv, t.ExpectNoAck ?
//t1 := t.OnStream("t1")
//t1.Expect(eventHi("X·A"))
})
}
// TestDeadlock demonstrates deadlock scenario hit by the checker.
// TestDeadlock demonstrates deadlock scenario.
func
TestDeadlock
(
t
*
testing
.
T
)
{
verify
(
t
,
func
(
t
*
tracetest
.
T
)
{
var
wg
sync
.
WaitGroup
...
...
@@ -239,20 +233,11 @@ var testExpectMap = map[string]testExpect{
"Test2ThreadsOK"
:
{
0
,
""
},
"TestDeadlock"
:
{
1
,
`--- FAIL: TestDeadlock (<TIME>)
example_test.go:1
61
: t2: recv: deadlock waiting for *tracetest_test.eventHi
example_test.go:1
61
: test shutdown: #streams: 2, #(pending events): 1
example_test.go:1
55
: t2: recv: deadlock waiting for *tracetest_test.eventHi
example_test.go:1
55
: test shutdown: #streams: 2, #(pending events): 1
t1 <- tracetest_test.eventHi T1·A
# t2
tracetest.go:<LINE>: t1: send: canceled (test failed)
`
},
"TestDeadlockQQQ"
:
{
1
,
`
--- FAIL: TestDeadlock \(.+s\)
example_test.go:161: t2: recv: deadlock waiting for *tracetest_test.eventHi
example_test.go:161: test shutdown: #streams: 2, #(pending events): 1
t1 <- tracetest_test.eventHi T1·A
# t2
tracetest.go:175: t1: send: canceled (test failed)
`
},
}
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