aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-05-24 00:01:20 +0800
committerGitHub <noreply@github.com>2023-05-23 16:01:20 +0000
commit910bf3154606107616ed7648004d80d323edf426 (patch)
tree9ae8b89c0fbe73cbf601ddeaa8a36e6333d73607
parenta9d417341c2e27df3fec2946dddbf30384734d64 (diff)
downloadgitea-910bf3154606107616ed7648004d80d323edf426.tar.gz
gitea-910bf3154606107616ed7648004d80d323edf426.zip
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>
-rw-r--r--modules/log/logger_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/log/logger_test.go b/modules/log/logger_test.go
index 1fb63bf629..a91b4d23af 100644
--- a/modules/log/logger_test.go
+++ b/modules/log/logger_test.go
@@ -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)