world_sync/tests/evidence/m11b2d_a1_pytest.txt
agent.develop 91ea85cd81 test(M11b-2d-A1): test_m11b2_single_tx.py 迁移函数式夹具消 collection error(48 条可收集,pytest 留证)
[M11b-2d-A1a] 收口提交内容:仅刷新 3 份 pytest 留证件(响应 QC 退回项 #1/#9 可复核性)。
- m11b2d_a1_pytest.txt / m11b2d_a1_collect_only.txt:头部补 INTERPRETER 绝对路径 + PYTEST_VERSION + PYTHON_VERSION + WORKDIR + GIT_HEAD,输出为 modules/world_sync 工作目录内实测原样全量输出。
- m11b2d_a1_pytest_ref_11aac66.txt:按 QC 改法 (b) 在 modules/world_sync 工作目录内以临时改写方式重跑对照实验,rootdir 与 CMD 一致(原件 rootdir 指向已删除的 tmp_diag/wsdiag 副本),并补 NOTE/PYTHON_VERSION;跑完测试文件按 HEAD 字节流还原(md5 d17cf7d68e3bfbef70c4f6b38a5bb643 一致,git status 归零)。
- tests/test_m11b2_single_tx.py 与 tests/_m11b2_compat.py 本任务零改动(git diff 为空),故未 add。
2026-09-22 23:34:44 +08:00

162 lines
13 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CMD: cd modules/world_sync && /d/pipeline/workspaces/0/sdlc_general/modules/world_sync/.venv/bin/python -m pytest tests/test_m11b2_single_tx.py -v --tb=short
# DATE: 2026-09-22T23:30:05+08:00
# INTERPRETER: /d/pipeline/workspaces/0/sdlc_general/modules/world_sync/.venv/bin/python
# PYTEST_VERSION: pytest 9.1.1
# PYTHON_VERSION: Python 3.10.12
# WORKDIR: /d/pipeline/workspaces/0/sdlc_general/modules/world_sync
# GIT_HEAD: 932bcd80724380098b2a545d00ed75e31fbd75d8 (932bcd8)
# TASK: M11b-2d-A1a 留证刷新(响应 QC #9 可复核性:补 INTERPRETER 绝对路径 / PYTEST_VERSION / PYTHON_VERSION)
# NOTE: 以下为上述命令在 modules/world_sync 工作目录内的 pytest 完整原样输出(未截断、未摘要、未修饰);pytest 自报 rootdir 与 # CMD/# WORKDIR 记录的工作目录一致。
# ROOT_CAUSE(分析注记,非命令输出): 8 条失败全部源自 tests/test_m11b2_single_tx.py:163 `"state_updates": su() if states is None else states` —— 应为 `[su()]`(数组)。该行由 b5c4467『deliver: 交付收口(引擎代为提交)』在携带 M11b-2d-A1c 外观债清理时误改(11aac66 原行为 `[su()]`,git diff 11aac66 HEAD 可见)。报错分布:5x RtxError[PBL-PARAM-0001] state_updates 必须是数组 + 3x 连带断言失败;夹具层(_m11b2_compat.py)与真源(pbl_runtime_ext/tx_write.py)无缺陷——真源按契约正确拒绝非数组入参。本任务禁改 test 文件,故仅登记并建议由后续任务恢复该行。
# FINDING: HEAD(932bcd8) 实测 8 failed / 32 passed / 8 xfailed / RC=1。8 条失败不在本任务范围内(本任务禁改 test 文件),由同目录 m11b2d_a1_pytest_ref_11aac66.txt 对照实验定位为 tests/test_m11b2_single_tx.py 在 11aac66..HEAD 之间的改动引入(见该件 # REGRESSION_SUSPECT 行)。
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-9.1.1, pluggy-1.6.0 -- /d/pipeline/workspaces/0/sdlc_general/modules/world_sync/.venv/bin/python
cachedir: .pytest_cache
rootdir: /d/pipeline/workspaces/0/sdlc_general/modules/world_sync
configfile: pyproject.toml
collecting ... collected 48 items
tests/test_m11b2_single_tx.py::TestNormalWrite::test_broadcast_happens_only_after_commit FAILED [ 2%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_event_and_state_written_in_one_transaction FAILED [ 4%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_event_row_is_append_only_without_version_backfill PASSED [ 6%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_multi_entity_state_updates PASSED [ 8%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_payload_serialised_into_payload_json_column FAILED [ 10%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_snapshot_written_in_same_transaction PASSED [ 12%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_trace_is_begin_commit_broadcast_in_that_order FAILED [ 14%]
tests/test_m11b2_single_tx.py::TestNormalWrite::test_update_path_bumps_version_server_side FAILED [ 16%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_append_only_guard_rejects_event_update_and_base_write FAILED [ 18%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_errors_are_never_swallowed PASSED [ 20%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_failed_write_leaves_no_event_row FAILED [ 22%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_immutable_column_in_set_guard PASSED [ 25%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_missing_not_null_column_guard PASSED [ 27%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_multi_entity_partial_failure_rolls_back_first_write PASSED [ 29%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_optimistic_lock_conflict_rolls_back_everything PASSED [ 31%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_unknown_column_guard PASSED [ 33%]
tests/test_m11b2_single_tx.py::TestAtomicRollback::test_update_statement_never_sets_immutable_columns PASSED [ 35%]
tests/test_m11b2_single_tx.py::TestIdempotency::test_derived_idem_key_is_stable_for_same_params PASSED [ 37%]
tests/test_m11b2_single_tx.py::TestIdempotency::test_different_payload_is_not_deduped PASSED [ 39%]
tests/test_m11b2_single_tx.py::TestIdempotency::test_duplicate_event_uid_dedups_without_second_write FAILED [ 41%]
tests/test_m11b2_single_tx.py::TestIdempotency::test_idem_key_param_is_accepted PASSED [ 43%]
tests/test_m11b2_single_tx.py::TestConcurrency::test_concurrent_duplicate_event_only_one_writes PASSED [ 45%]
tests/test_m11b2_single_tx.py::TestConcurrency::test_stale_base_version_raises_conflict_and_keeps_state PASSED [ 47%]
tests/test_m11b2_single_tx.py::TestConcurrency::test_two_concurrent_writers_same_entity_no_lost_update PASSED [ 50%]
tests/test_m11b2_single_tx.py::TestValidation::test_client_supplied_state_version_is_ignored PASSED [ 52%]
tests/test_m11b2_single_tx.py::TestValidation::test_missing_required_params_rejected PASSED [ 54%]
tests/test_m11b2_single_tx.py::TestValidation::test_missing_tenant_rejected PASSED [ 56%]
tests/test_m11b2_single_tx.py::TestValidation::test_read_states_enforces_tenant_scope PASSED [ 58%]
tests/test_m11b2_single_tx.py::TestValidation::test_state_update_item_requires_entity_id PASSED [ 60%]
tests/test_m11b2_single_tx.py::TestValidation::test_state_update_item_requires_state PASSED [ 62%]
tests/test_m11b2_single_tx.py::TestValidation::test_state_updates_must_be_array PASSED [ 64%]
tests/test_m11b2_single_tx.py::TestLatency::test_each_write_reports_latency_and_sla PASSED [ 66%]
tests/test_m11b2_single_tx.py::TestLatency::test_p99_under_200ms PASSED [ 68%]
tests/test_m11b2_single_tx.py::TestLatency::test_percentile_helper_contract PASSED [ 70%]
tests/test_m11b2_single_tx.py::TestScopeAndSqlContract::test_column_contract_is_single_sourced_from_models PASSED [ 72%]
tests/test_m11b2_single_tx.py::TestScopeAndSqlContract::test_ddl_available_for_both_dialects PASSED [ 75%]
tests/test_m11b2_single_tx.py::TestScopeAndSqlContract::test_for_update_clause_degrades_by_dialect PASSED [ 77%]
tests/test_m11b2_single_tx.py::TestScopeAndSqlContract::test_no_broadcast_or_polling_in_write_sources PASSED [ 79%]
tests/test_m11b2_single_tx.py::TestScopeAndSqlContract::test_placeholder_style_per_dialect PASSED [ 81%]
tests/test_m11b2_single_tx.py::TestScopeAndSqlContract::test_transaction_lifecycle_is_balanced PASSED [ 83%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_before_commit_hook_failure_rolls_back_everything XFAIL [ 85%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_duplicate_event_raises_event_write_error XFAIL [ 87%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_event_row_state_version_aligned_with_written_state XFAIL [ 89%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_failure_raises_world_sync_exception_family XFAIL [ 91%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_key_mismatch_between_event_and_state_rejected XFAIL [ 93%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_module_level_helper_uses_configured_writer XFAIL [ 95%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_plan_assembly_is_side_effect_free XFAIL [ 97%]
tests/test_m11b2_single_tx.py::TestRetiredContractCases::test_unserialisable_payload_rejected XFAIL [100%]
=================================== FAILURES ===================================
___________ TestNormalWrite.test_broadcast_happens_only_after_commit ___________
tests/test_m11b2_single_tx.py:282: in test_broadcast_happens_only_after_commit
self.apply("ev-bc")
tests/test_m11b2_single_tx.py:169: in apply
return compat.apply(**params)
tests/_m11b2_compat.py:431: in apply
return asyncio.run(apply_runtime_event(**kwargs))
/usr/lib/python3.10/asyncio/runners.py:44: in run
return loop.run_until_complete(main)
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
return future.result()
../pbl_runtime_ext/pbl_runtime_ext/tx_write.py:359: in apply_runtime_event
raise rtx_db.RtxError(ERR_BAD_PARAM, "state_updates 必须是数组")
E pbl_runtime_ext.rtx_db.RtxError: [PBL-PARAM-0001] state_updates 必须是数组
_______ TestNormalWrite.test_event_and_state_written_in_one_transaction ________
tests/test_m11b2_single_tx.py:213: in test_event_and_state_written_in_one_transaction
res = self.apply("ev-ok")
tests/test_m11b2_single_tx.py:169: in apply
return compat.apply(**params)
tests/_m11b2_compat.py:431: in apply
return asyncio.run(apply_runtime_event(**kwargs))
/usr/lib/python3.10/asyncio/runners.py:44: in run
return loop.run_until_complete(main)
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
return future.result()
../pbl_runtime_ext/pbl_runtime_ext/tx_write.py:359: in apply_runtime_event
raise rtx_db.RtxError(ERR_BAD_PARAM, "state_updates 必须是数组")
E pbl_runtime_ext.rtx_db.RtxError: [PBL-PARAM-0001] state_updates 必须是数组
_______ TestNormalWrite.test_payload_serialised_into_payload_json_column _______
tests/test_m11b2_single_tx.py:276: in test_payload_serialised_into_payload_json_column
self.apply("ev-p", payload={"a": 1, "b": [1, 2]})
tests/test_m11b2_single_tx.py:169: in apply
return compat.apply(**params)
tests/_m11b2_compat.py:431: in apply
return asyncio.run(apply_runtime_event(**kwargs))
/usr/lib/python3.10/asyncio/runners.py:44: in run
return loop.run_until_complete(main)
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
return future.result()
../pbl_runtime_ext/pbl_runtime_ext/tx_write.py:359: in apply_runtime_event
raise rtx_db.RtxError(ERR_BAD_PARAM, "state_updates 必须是数组")
E pbl_runtime_ext.rtx_db.RtxError: [PBL-PARAM-0001] state_updates 必须是数组
______ TestNormalWrite.test_trace_is_begin_commit_broadcast_in_that_order ______
tests/test_m11b2_single_tx.py:238: in test_trace_is_begin_commit_broadcast_in_that_order
self.apply("ev-order")
tests/test_m11b2_single_tx.py:169: in apply
return compat.apply(**params)
tests/_m11b2_compat.py:431: in apply
return asyncio.run(apply_runtime_event(**kwargs))
/usr/lib/python3.10/asyncio/runners.py:44: in run
return loop.run_until_complete(main)
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
return future.result()
../pbl_runtime_ext/pbl_runtime_ext/tx_write.py:359: in apply_runtime_event
raise rtx_db.RtxError(ERR_BAD_PARAM, "state_updates 必须是数组")
E pbl_runtime_ext.rtx_db.RtxError: [PBL-PARAM-0001] state_updates 必须是数组
__________ TestNormalWrite.test_update_path_bumps_version_server_side __________
tests/test_m11b2_single_tx.py:257: in test_update_path_bumps_version_server_side
self.assertNotIn("state_version=?", sql.split("WHERE")[0].replace(
E AssertionError: 'state_version=?' unexpectedly found in 'UPDATE pbl_entity_state SET state_json=%s, state_version=?, checksum=%s, updated_by=%s, updated_at=%s '
_ TestAtomicRollback.test_append_only_guard_rejects_event_update_and_base_write _
tests/test_m11b2_single_tx.py:389: in test_append_only_guard_rejects_event_update_and_base_write
self.apply("ev-guard")
tests/test_m11b2_single_tx.py:169: in apply
return compat.apply(**params)
tests/_m11b2_compat.py:431: in apply
return asyncio.run(apply_runtime_event(**kwargs))
/usr/lib/python3.10/asyncio/runners.py:44: in run
return loop.run_until_complete(main)
/usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
return future.result()
../pbl_runtime_ext/pbl_runtime_ext/tx_write.py:359: in apply_runtime_event
raise rtx_db.RtxError(ERR_BAD_PARAM, "state_updates 必须是数组")
E pbl_runtime_ext.rtx_db.RtxError: [PBL-PARAM-0001] state_updates 必须是数组
___________ TestAtomicRollback.test_failed_write_leaves_no_event_row ___________
tests/test_m11b2_single_tx.py:408: in test_failed_write_leaves_no_event_row
with self.assertRaises(RtxError):
E AssertionError: RtxError not raised
_____ TestIdempotency.test_duplicate_event_uid_dedups_without_second_write _____
tests/test_m11b2_single_tx.py:432: in test_duplicate_event_uid_dedups_without_second_write
self.assertEqual(2, self.state_row()["state_version"]) # 仍为 1->2,未被二次写改
E AssertionError: 2 != 1
=========================== short test summary info ============================
FAILED tests/test_m11b2_single_tx.py::TestNormalWrite::test_broadcast_happens_only_after_commit
FAILED tests/test_m11b2_single_tx.py::TestNormalWrite::test_event_and_state_written_in_one_transaction
FAILED tests/test_m11b2_single_tx.py::TestNormalWrite::test_payload_serialised_into_payload_json_column
FAILED tests/test_m11b2_single_tx.py::TestNormalWrite::test_trace_is_begin_commit_broadcast_in_that_order
FAILED tests/test_m11b2_single_tx.py::TestNormalWrite::test_update_path_bumps_version_server_side
FAILED tests/test_m11b2_single_tx.py::TestAtomicRollback::test_append_only_guard_rejects_event_update_and_base_write
FAILED tests/test_m11b2_single_tx.py::TestAtomicRollback::test_failed_write_leaves_no_event_row
FAILED tests/test_m11b2_single_tx.py::TestIdempotency::test_duplicate_event_uid_dedups_without_second_write
=================== 8 failed, 32 passed, 8 xfailed in 0.66s ====================
# RC=1