From 910bf3154606107616ed7648004d80d323edf426 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 24 May 2023 00:01:20 +0800 Subject: [PATCH] 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 --- modules/log/logger_test.go | 1 + 1 file changed, 1 insertion(+) 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)