Skip to content

Commit 7cc59ef

Browse files
committed
(Hopefully) resolve flaky tests
Mark tests that rely on global state as serial-execution-only Assisted-By: claude-opus-4.6
1 parent ac64463 commit 7cc59ef

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

pulp_rpm/tests/functional/api/test_pulpimport.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def test_distribution_tree_import(
245245
assert trees.count == 1
246246

247247

248+
@pytest.mark.serial # Runs orphan cleanup to create a content-free zone; conflicts with parallel tests
248249
def test_clean_import(
249250
rpm_repository_api,
250251
import_export_repositories,
@@ -286,6 +287,7 @@ def test_clean_import(
286287
assert rpm_repository_api.list().count == existing_repos
287288

288289

290+
@pytest.mark.serial # Runs orphan cleanup to create a content-free zone; conflicts with parallel tests
289291
def test_create_missing_repos(
290292
init_and_sync,
291293
rpm_rpmremote_api,

pulp_rpm/tests/functional/api/test_repo_sizes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import json
22
import subprocess
33

4+
import pytest
5+
46
from pulp_rpm.tests.functional.constants import (
57
RPM_UNSIGNED_FIXTURE_URL,
68
RPM_UNSIGNED_FIXTURE_SIZE,
@@ -9,6 +11,7 @@
911
)
1012

1113

14+
@pytest.mark.serial # Asserts exact disk-size; parallel immediate syncs share artifacts and inflate it
1215
def test_repo_size(init_and_sync, delete_orphans_pre, monitor_task, pulpcore_bindings):
1316
"""Test that RPM repos correctly report their on-disk artifact sizes."""
1417
monitor_task(pulpcore_bindings.OrphansCleanupApi.cleanup({"orphan_protection_time": 0}).task)
@@ -39,6 +42,7 @@ def test_repo_size(init_and_sync, delete_orphans_pre, monitor_task, pulpcore_bin
3942
assert report["on-demand-size"] == 0
4043

4144

45+
@pytest.mark.serial # Asserts exact disk-size; parallel immediate syncs share artifacts and inflate it
4246
def test_kickstart_repo_size(init_and_sync, delete_orphans_pre, monitor_task, pulpcore_bindings):
4347
"""Test that kickstart RPM repos correctly report their on-disk artifact sizes."""
4448
monitor_task(pulpcore_bindings.OrphansCleanupApi.cleanup({"orphan_protection_time": 0}).task)

0 commit comments

Comments
 (0)