Skip to content

Commit 487b9a8

Browse files
chore: attempt to fix flaky functional test
Add an additional check to attempt to solve the flakiness of the test_merge_request_should_remove_source_branch() test.
1 parent d8de4dc commit 487b9a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/functional/api/test_merge_requests.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,18 @@ def test_merge_request_should_remove_source_branch(
125125
time.sleep(0.5)
126126
assert mr.merged_at is not None
127127
time.sleep(0.5)
128+
result = wait_for_sidekiq(timeout=60)
129+
assert result is True, "sidekiq process should have terminated but did not"
128130

129131
# Ensure we can NOT get the MR branch
130132
with pytest.raises(gitlab.exceptions.GitlabGetError):
131-
project.branches.get(source_branch)
133+
result = project.branches.get(source_branch)
134+
# Help to debug in case the expected exception doesn't happen.
135+
import pprint
136+
137+
print("mr:", pprint.pformat(mr))
138+
print("mr.merged_at:", pprint.pformat(mr.merged_at))
139+
print("result:", pprint.pformat(result))
132140

133141

134142
def test_merge_request_large_commit_message(

0 commit comments

Comments
 (0)