From f1a0b641090bee7336e94d76ac6a89f479ea070c Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 30 Apr 2023 21:25:42 +0200 Subject: [PATCH] Skip known flaky `queue` tests on CI environment (#24443) Backport of https://github.com/go-gitea/gitea/pull/24419 to 1.19. --- modules/queue/queue_channel_test.go | 4 ++++ modules/queue/unique_queue_disk_channel_test.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/modules/queue/queue_channel_test.go b/modules/queue/queue_channel_test.go index 9b92398bac..f9dae742e2 100644 --- a/modules/queue/queue_channel_test.go +++ b/modules/queue/queue_channel_test.go @@ -4,6 +4,7 @@ package queue import ( + "os" "sync" "testing" "time" @@ -101,6 +102,9 @@ func TestChannelQueue_Batch(t *testing.T) { } func TestChannelQueue_Pause(t *testing.T) { + if os.Getenv("CI") != "" { + t.Skip("Skipping because test is flaky on CI") + } lock := sync.Mutex{} var queue Queue var err error diff --git a/modules/queue/unique_queue_disk_channel_test.go b/modules/queue/unique_queue_disk_channel_test.go index fd76163f4a..7417d74c0b 100644 --- a/modules/queue/unique_queue_disk_channel_test.go +++ b/modules/queue/unique_queue_disk_channel_test.go @@ -5,6 +5,7 @@ package queue import ( "fmt" + "os" "strconv" "sync" "testing" @@ -16,6 +17,9 @@ import ( ) func TestPersistableChannelUniqueQueue(t *testing.T) { + if os.Getenv("CI") != "" { + t.Skip("Skipping because test is flaky on CI") + } tmpDir := t.TempDir() fmt.Printf("TempDir %s\n", tmpDir) _ = log.NewLogger(1000, "console", "console", `{"level":"warn","stacktracelevel":"NONE","stderr":true}`)