mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-26 05:30:27 +00:00
Queue tests: extend time in waitForProcess() to work agents under load too (#4455)
This commit is contained in:
@@ -35,7 +35,7 @@ var (
|
|||||||
Data: []byte("{}"),
|
Data: []byte("{}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
waitForProcess = func() { time.Sleep(processTimeInterval + 10*time.Millisecond) }
|
waitForProcess = func() { time.Sleep(processTimeInterval + 50*time.Millisecond) }
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFifo(t *testing.T) {
|
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")
|
assert.Len(t, info.Pending, 1, "expect task in pending queue")
|
||||||
|
|
||||||
got, err := q.Poll(ctx, 1, filterFnTrue)
|
got, err := q.Poll(ctx, 1, filterFnTrue)
|
||||||
waitForProcess()
|
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, dummyTask, got)
|
assert.Equal(t, dummyTask, got)
|
||||||
|
|
||||||
|
waitForProcess()
|
||||||
info = q.Info(ctx)
|
info = q.Info(ctx)
|
||||||
assert.Len(t, info.Pending, 1, "expect task re-added to pending queue")
|
assert.Len(t, info.Pending, 1, "expect task re-added to pending queue")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user