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
59440b8b
Commit
59440b8b
authored
Jan 03, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
084908f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
go/internal/xtracing/tracetest/tracetest.go
go/internal/xtracing/tracetest/tracetest.go
+18
-18
No files found.
go/internal/xtracing/tracetest/tracetest.go
View file @
59440b8b
...
@@ -263,24 +263,6 @@ func Verify(t *testing.T, f func(t *T)) {
...
@@ -263,24 +263,6 @@ func Verify(t *testing.T, f func(t *T)) {
}
}
// fatalfInNonMain should be called for fatal cases in non-main goroutines instead of panic.
//
// we don't panic because it will stop the process and prevent the main
// goroutine to print detailed reason for e.g. deadlock or other error.
var
fatalLogMu
sync
.
Mutex
func
(
t
*
T
)
fatalfInNonMain
(
format
string
,
argv
...
interface
{})
{
t
.
Helper
()
// serialize fatal log+traceback printout, so that such printouts from
// multiple goroutines do not get intermixed.
fatalLogMu
.
Lock
()
defer
fatalLogMu
.
Unlock
()
t
.
Logf
(
format
,
argv
...
)
t
.
Logf
(
"%s
\n
"
,
debug
.
Stack
())
runtime
.
Goexit
()
}
// T overrides FailNow/Fatal/Fatalf to also cancel all in-progress sends.
// T overrides FailNow/Fatal/Fatalf to also cancel all in-progress sends.
func
(
t
*
T
)
FailNow
()
{
func
(
t
*
T
)
FailNow
()
{
t
.
Helper
()
t
.
Helper
()
...
@@ -512,3 +494,21 @@ func (t *T) expect1(stream string, eventExpect interface{}) *_Msg {
...
@@ -512,3 +494,21 @@ func (t *T) expect1(stream string, eventExpect interface{}) *_Msg {
return
msg
return
msg
}
}
// fatalfInNonMain should be called for fatal cases in non-main goroutines instead of panic.
//
// we don't panic because it will stop the process and prevent the main
// goroutine to print detailed reason for e.g. deadlock or other error.
var
fatalLogMu
sync
.
Mutex
func
(
t
*
T
)
fatalfInNonMain
(
format
string
,
argv
...
interface
{})
{
t
.
Helper
()
// serialize fatal log+traceback printout, so that such printouts from
// multiple goroutines do not get intermixed.
fatalLogMu
.
Lock
()
defer
fatalLogMu
.
Unlock
()
t
.
Logf
(
format
,
argv
...
)
t
.
Logf
(
"%s
\n
"
,
debug
.
Stack
())
runtime
.
Goexit
()
}
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