Skip to content

Commit 01569ea

Browse files
chore: move to GitLab 15.6.8-ee.0
1 parent d435782 commit 01569ea

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

tests/functional/conftest.py

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,32 @@ def _check(
209209
return _check
210210

211211

212-
@pytest.fixture
212+
def wait_for_sidekiq_function(
213+
*,
214+
gl_instance: gitlab.Gitlab,
215+
timeout: int = 30,
216+
step: float = 0.5,
217+
allow_fail: bool = False,
218+
) -> bool:
219+
"""A function that is called to wait for the sidekiq process to finish. As
220+
opposed to the fixture."""
221+
for count in range(timeout):
222+
time.sleep(step)
223+
busy = False
224+
process_metrics = gl_instance.sidekiq.process_metrics()
225+
assert isinstance(process_metrics, dict)
226+
processes = process_metrics["processes"]
227+
for process in processes:
228+
if process["busy"]:
229+
busy = True
230+
if not busy:
231+
return True
232+
logging.info(f"sidekiq busy {count} of {timeout}")
233+
assert allow_fail, "sidekiq process should have terminated but did not."
234+
return False
235+
236+
237+
@pytest.fixture(scope="function")
213238
def wait_for_sidekiq(gl):
214239
"""
215240
Return a helper function to wait until there are no busy sidekiq processes.
@@ -218,18 +243,9 @@ def wait_for_sidekiq(gl):
218243
"""
219244

220245
def _wait(timeout: int = 30, step: float = 0.5, allow_fail: bool = False) -> bool:
221-
for count in range(timeout):
222-
time.sleep(step)
223-
busy = False
224-
processes = gl.sidekiq.process_metrics()["processes"]
225-
for process in processes:
226-
if process["busy"]:
227-
busy = True
228-
if not busy:
229-
return True
230-
logging.info(f"sidekiq busy {count} of {timeout}")
231-
assert allow_fail, "sidekiq process should have terminated but did not."
232-
return False
246+
return wait_for_sidekiq_function(
247+
gl_instance=gl, timeout=timeout, step=step, allow_fail=allow_fail
248+
)
233249

234250
return _wait
235251

@@ -529,6 +545,8 @@ def user(gl):
529545

530546
yield user
531547

548+
result = wait_for_sidekiq_function(gl_instance=gl, timeout=60)
549+
assert result is True, "sidekiq process should have terminated but did not"
532550
# Use `hard_delete=True` or a 'Ghost User' may be created.
533551
helpers.safe_delete(user, hard_delete=True)
534552

tests/functional/fixtures/.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
GITLAB_IMAGE=gitlab/gitlab-ee
2-
GITLAB_TAG=15.5.9-ee.0
2+
# GITLAB_TAG=15.6.8-ee.0
3+
GITLAB_TAG=15.6.0-ee.0

0 commit comments

Comments
 (0)