Skip to content

Commit d9b1386

Browse files
committed
wip: correct testing resource_blocker fixture
1 parent b2fca1e commit d9b1386

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

pulpcore/tests/functional/api/test_tasking.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -508,22 +508,13 @@ def test_timeouts_on_api_worker(self, pulpcore_bindings, dispatch_task):
508508
@pytest.fixture
509509
def resource_blocker(pulpcore_bindings, dispatch_task):
510510

511-
def wait_until(state, task_href, timeout=10):
512-
for i in range(timeout):
513-
task = pulpcore_bindings.TasksApi.read(task_href)
514-
if task.state == state:
515-
return
516-
time.sleep(1)
517-
raise RuntimeError("Timeout waiting for task to transition")
518-
519511
@contextmanager
520512
def _resource_blocker(exclusive_resources: list[str], duration=20):
521513
task_href = dispatch_task(
522514
"pulpcore.app.tasks.test.sleep",
523515
args=(duration,),
524516
exclusive_resources=exclusive_resources,
525517
)
526-
wait_until("running", task_href)
527518
yield
528519
# Trying to cancel a finished task will return a 409 code.
529520
# We can ignore if that's the case, because all we want here is to cut time down.

0 commit comments

Comments
 (0)