summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-19 21:49:34 +0300
committerValery Piashchynski <[email protected]>2021-08-19 21:49:34 +0300
commiteb007d800a4970c6838567de4a3bfffbd4fbede0 (patch)
treea1ff40909739b3f86cc021c0b21bdf67b5138f6b /tests
parent4e0b42efbbc571fa9e5cc423d908580d477eae51 (diff)
Retry for the beanstalk test
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/jobs/jobs_beanstalk_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/plugins/jobs/jobs_beanstalk_test.go b/tests/plugins/jobs/jobs_beanstalk_test.go
index 39a7f443..8e74c7cc 100644
--- a/tests/plugins/jobs/jobs_beanstalk_test.go
+++ b/tests/plugins/jobs/jobs_beanstalk_test.go
@@ -426,6 +426,18 @@ func TestBeanstalkStats(t *testing.T) {
assert.Equal(t, out.Driver, "beanstalk")
assert.Equal(t, out.Queue, "default")
+ // try 5 times
+ if out.Active == 0 {
+ for i := 0; i < 5; i++ {
+ time.Sleep(time.Second)
+ out = &jobState.State{}
+ t.Run("Stats", stats(out))
+ if out.Active == 1 {
+ break
+ }
+ }
+ }
+
assert.Equal(t, int64(1), out.Active)
assert.Equal(t, int64(1), out.Delayed)
assert.Equal(t, int64(0), out.Reserved)