1
0
mirror of https://github.com/golang/go synced 2024-11-06 17:26:10 -07:00
go/src/log
Ziheng Liu 42f8199290 all: fix incorrect channel and API usage in some unit tests
This CL changes some unit test functions, making sure that these tests (and goroutines spawned during test) won't block.
Since they are just test functions, I use one CL to fix them all. I hope this won't cause trouble to reviewers and can save time for us.
There are three main categories of incorrect logic fixed by this CL:
1. Use testing.Fatal()/Fatalf() in spawned goroutines, which is forbidden by Go's document.
2. Channels are used in such a way that, when errors or timeout happen, the test will be blocked and never return.
3. Channels are used in such a way that, when errors or timeout happen, the test can return but some spawned goroutines will be leaked, occupying resource until all other tests return and the process is killed.

Change-Id: I3df931ec380794a0cf1404e632c1dd57c65d63e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/219380
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-02-27 19:04:17 +00:00
..
syslog all: fix incorrect channel and API usage in some unit tests 2020-02-27 19:04:17 +00:00
example_test.go log: adds a Logger Output method Example 2017-07-16 03:57:11 +00:00
log_test.go log: add Lmsgprefix flag 2019-09-13 23:21:54 +00:00
log.go log: mention names of flag constants in {Set,}Flags doc comments 2019-09-24 23:29:19 +00:00