Skip to content

Commit 5cc60d5

Browse files
authored
Merge pull request #1316 from JohnVillalovos/jlvillal/test_wait
test: extend wait timeout for test_delete_user()
2 parents 2b29776 + 19fde8e commit 5cc60d5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tools/functional/api/test_users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def test_delete_user(gl, wait_for_sidekiq):
5656
)
5757

5858
new_user.delete()
59-
wait_for_sidekiq()
59+
result = wait_for_sidekiq(timeout=60)
60+
assert result == True, "sidekiq process should have terminated but did not"
6061

6162
assert new_user.id not in [user.id for user in gl.users.list()]
6263

tools/functional/conftest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,15 @@ def wait_for_sidekiq(gl):
8989

9090
def _wait(timeout=30, step=0.5):
9191
for _ in range(timeout):
92-
if not gl.sidekiq.process_metrics()["processes"][0]["busy"]:
93-
return
9492
time.sleep(step)
93+
busy = False
94+
processes = gl.sidekiq.process_metrics()["processes"]
95+
for process in processes:
96+
if process["busy"]:
97+
busy = True
98+
if not busy:
99+
return True
100+
return False
95101

96102
return _wait
97103

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy