1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-22 12:54:53 -05:00

Fix flakey test in logger test (#24883)

Fix #24882

The goroutines are all asynchronized. So it needs a little "sleep" to
make sure the writer's goroutine has been paused before sending messages
to it.

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
wxiaoguang 2023-05-24 00:01:20 +08:00 committed by GitHub
parent a9d417341c
commit 910bf31546
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,6 +94,7 @@ func TestLoggerPause(t *testing.T) {
logger.AddWriters(w1)
GetManager().PauseAll()
time.Sleep(50 * time.Millisecond)
logger.Info("info-level")
time.Sleep(100 * time.Millisecond)