Skip known flaky queue tests on CI environment (#24443)

Backport of https://github.com/go-gitea/gitea/pull/24419 to 1.19.
This commit is contained in:
silverwind 2023-04-30 21:25:42 +02:00 committed by GitHub
parent bfdbc626cb
commit f1a0b64109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -4,6 +4,7 @@
package queue package queue
import ( import (
"os"
"sync" "sync"
"testing" "testing"
"time" "time"
@ -101,6 +102,9 @@ func TestChannelQueue_Batch(t *testing.T) {
} }
func TestChannelQueue_Pause(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{} lock := sync.Mutex{}
var queue Queue var queue Queue
var err error var err error

View file

@ -5,6 +5,7 @@ package queue
import ( import (
"fmt" "fmt"
"os"
"strconv" "strconv"
"sync" "sync"
"testing" "testing"
@ -16,6 +17,9 @@ import (
) )
func TestPersistableChannelUniqueQueue(t *testing.T) { func TestPersistableChannelUniqueQueue(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("Skipping because test is flaky on CI")
}
tmpDir := t.TempDir() tmpDir := t.TempDir()
fmt.Printf("TempDir %s\n", tmpDir) fmt.Printf("TempDir %s\n", tmpDir)
_ = log.NewLogger(1000, "console", "console", `{"level":"warn","stacktracelevel":"NONE","stderr":true}`) _ = log.NewLogger(1000, "console", "console", `{"level":"warn","stacktracelevel":"NONE","stderr":true}`)