fix(actor): move namespace filter inside lock in ActorLoader.list_actors
ISSUES CLOSED: #8588 Replace type: ignore suppressions with cast() + getattr() per review feedback.
This commit is contained in:
@@ -9,6 +9,7 @@ from pathlib import Path
|
||||
|
||||
from behave import given, then, when
|
||||
from behave.runner import Context
|
||||
from typing import cast
|
||||
|
||||
from cleveragents.actor.loader import ActorLoader
|
||||
from cleveragents.actor.schema import ActorConfigSchema
|
||||
@@ -451,8 +452,8 @@ def step_when_concurrent_list_actors_with_clear(
|
||||
@then("all concurrent list_actors calls should return consistent results")
|
||||
def step_then_concurrent_results_consistent(context: Context) -> None:
|
||||
"""Verify that all concurrent list_actors calls returned consistent results."""
|
||||
results: list[list[ActorConfigSchema]] = context._concurrent_list_results # type: ignore[assignment]
|
||||
namespace: str = context._concurrent_namespace # type: ignore[assignment]
|
||||
results = cast(list[list[ActorConfigSchema]], getattr(context, "_concurrent_list_results", []))
|
||||
namespace = cast(str, getattr(context, "_concurrent_namespace", ""))
|
||||
|
||||
# Each result should only contain actors from the requested namespace.
|
||||
# When clear() runs concurrently, some threads may see the full list while
|
||||
|
||||
Reference in New Issue
Block a user