diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-05-24 00:01:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 16:01:20 +0000 |
commit | 910bf3154606107616ed7648004d80d323edf426 (patch) | |
tree | 9ae8b89c0fbe73cbf601ddeaa8a36e6333d73607 | |
parent | a9d417341c2e27df3fec2946dddbf30384734d64 (diff) | |
download | gitea-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.go | 1 |
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) |