1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-02-04 18:21:06 +02:00

Queue tests: extend time in waitForProcess() to work agents under load too (#4455)

This commit is contained in:
6543 2024-11-27 14:49:42 +01:00 committed by GitHub
parent 08bd52a1b1
commit de82236aee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,7 @@ var (
Data: []byte("{}"),
}
}
waitForProcess = func() { time.Sleep(processTimeInterval + 10*time.Millisecond) }
waitForProcess = func() { time.Sleep(processTimeInterval + 50*time.Millisecond) }
)
func TestFifo(t *testing.T) {
@ -83,10 +83,10 @@ func TestFifoExpire(t *testing.T) {
assert.Len(t, info.Pending, 1, "expect task in pending queue")
got, err := q.Poll(ctx, 1, filterFnTrue)
waitForProcess()
assert.NoError(t, err)
assert.Equal(t, dummyTask, got)
waitForProcess()
info = q.Info(ctx)
assert.Len(t, info.Pending, 1, "expect task re-added to pending queue")
}