Skip to content

Commit b5de7a3

Browse files
committed
Update tasking tests to expect generic internal error messages
1 parent ba22c61 commit b5de7a3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pulpcore/tests/functional/api/test_tasking.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ def test_executes_on_api_worker_when_no_async(
468468
"pulpcore.app.tasks.test.sleep", args=(LT_TIMEOUT,), immediate=True
469469
)
470470
monitor_task(task_href)
471-
assert "Immediate tasks must be async functions" in ctx.value.task.error["description"]
471+
# Assert masked internal error; underlying cause is ValueError("Immediate tasks must be async functions")
472+
assert "An internal error occured." in ctx.value.task.error["description"]
472473

473474
@pytest.mark.parallel
474475
def test_timeouts_on_api_worker(self, pulpcore_bindings, dispatch_task):
@@ -484,7 +485,8 @@ def test_timeouts_on_api_worker(self, pulpcore_bindings, dispatch_task):
484485
)
485486
task = pulpcore_bindings.TasksApi.read(task_href)
486487
assert task.state == "failed"
487-
assert "timed out after" in task.error["description"]
488+
# Assert masked internal error; underlying cause is asyncio.TimeoutError
489+
assert "An internal error occured." in task.error["description"]
488490

489491

490492
@pytest.fixture
@@ -576,4 +578,5 @@ def test_times_out_on_task_worker(
576578
exclusive_resources=[COMMON_RESOURCE],
577579
)
578580
monitor_task(task_href)
579-
assert "timed out after" in ctx.value.task.error["description"]
581+
# Assert masked internal error; underlying cause is asyncio.TimeoutError
582+
assert "An internal error occured." in ctx.value.task.error["description"]

0 commit comments

Comments
 (0)