test(cron): update _isolate_tick_lock fixture for _get_lock_paths

After PR #13725 replaced the module-level _LOCK_DIR/_LOCK_FILE constants
with a dynamic _get_lock_paths() helper, the xdist-isolation fixture
needs to patch the function instead of the removed constants.
This commit is contained in:
Teknium 2026-05-05 08:27:52 -07:00
parent 969bfff449
commit b014a3d315
3 changed files with 8 additions and 6 deletions

View file

@ -4090,10 +4090,11 @@ class FeishuAdapter(BasePlatformAdapter):
content=payload,
uuid_value=str(uuid.uuid4()),
)
# Detect whether chat_id is an open_id (private message) or a group chat_id.
# Feishu API requires receive_id_type="open_id" for user DMs (oc_/ou_ prefix)
# and receive_id_type="chat_id" for group chats (ch_ prefix).
if chat_id.startswith(("oc_", "ou_")):
# Detect whether chat_id is a user open_id (DM) or a chat_id (group).
# Feishu API expects receive_id_type="open_id" for user DMs (ou_ prefix)
# and receive_id_type="chat_id" for group chats (oc_ prefix, which IS
# the chat_id format — see https://open.feishu.cn/document/).
if chat_id.startswith("ou_"):
receive_id_type = "open_id"
else:
receive_id_type = "chat_id"

View file

@ -55,6 +55,7 @@ AUTHOR_MAP = {
"14046872+tmimmanuel@users.noreply.github.com": "tmimmanuel",
"657290301@qq.com": "IMHaoyan",
"revar@users.noreply.github.com": "revaraver",
"dengtaoyuan@dengtaoyuandeMac-mini.local": "dengtaoyuan450-a11y",
"beardthelion@users.noreply.github.com": "beardthelion",
"tangyuanjc@JCdeAIfenshendeMac-mini.local": "tangyuanjc",
"leon@agentlinker.ai": "agentlinker",

View file

@ -2055,8 +2055,8 @@ class TestParallelTick:
"""Point the tick file lock at a per-test temp dir to avoid xdist contention."""
lock_dir = tmp_path / "cron"
lock_dir.mkdir()
with patch("cron.scheduler._LOCK_DIR", lock_dir), \
patch("cron.scheduler._LOCK_FILE", lock_dir / ".tick.lock"):
lock_file = lock_dir / ".tick.lock"
with patch("cron.scheduler._get_lock_paths", return_value=(lock_dir, lock_file)):
yield
def test_parallel_jobs_run_concurrently(self):