修复复核发现的问题: 坐标缩放、升级/同步判定、看门狗诊断、卡死检测
- scripts/lc_ui.py: 脚本坐标按 1600x900 书写, OCR 结果与点击/拖动按实际客户区换算; 去掉写死的 D:\lc-mcp 路径 - levelup.py: 升级以详情页等级/经验条变化判定成功; 同步先判断弹窗是否仍在, 无过场时不再多按 ESC、不再盲点取消 - auto_cycle.py: task_status 连续报 stall 即停任务; exit 0 但有 errors 判失败 - tasks.py: 运行中日志尾部"配队人数OCR得到"刷屏时返回 stall 字段 - keep_display.ps1: tscon 改用 -EncodedCommand 并记录退出码; 会话号自动取游戏所在会话 - 更正 10-05 README 选队结论、summary 卡死①统计、PITFALLS 坑 13 根因 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -675,5 +675,41 @@ class TaskErrorSurfaceTest(unittest.TestCase):
|
|||||||
self.assertNotIn('errors', status)
|
self.assertNotIn('errors', status)
|
||||||
|
|
||||||
|
|
||||||
|
class TaskStallSurfaceTest(unittest.TestCase):
|
||||||
|
"""空队伍卡死时进程健在、日志无报错, 只有编队人数检查在刷屏。"""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def child(repeats):
|
||||||
|
return ('import sys, time\n'
|
||||||
|
'for _ in range(%d):\n'
|
||||||
|
' sys.stdout.write("[DEBUG] tasks\\\\teams\\\\team_formation.py:225: '
|
||||||
|
'对于配队人数OCR得到:0/5\\n")\n'
|
||||||
|
'sys.stdout.flush()\n'
|
||||||
|
'time.sleep(30)\n' % repeats)
|
||||||
|
|
||||||
|
def status_while_running(self, repeats):
|
||||||
|
with tempfile.TemporaryDirectory() as d:
|
||||||
|
runner = TaskRunner(d, argv_factory=lambda t, p: [sys.executable, '-c', self.child(repeats)])
|
||||||
|
self.assertTrue(runner.start('daily', {})['ok'])
|
||||||
|
try:
|
||||||
|
deadline = time.time() + 15
|
||||||
|
while time.time() < deadline and repeats and not os.path.getsize(runner.info['log']):
|
||||||
|
time.sleep(0.05)
|
||||||
|
time.sleep(0.2)
|
||||||
|
return runner.status()
|
||||||
|
finally:
|
||||||
|
runner.stop()
|
||||||
|
|
||||||
|
def test_repeated_empty_team_check_is_reported(self):
|
||||||
|
status = self.status_while_running(12)
|
||||||
|
self.assertEqual(status['state'], 'running')
|
||||||
|
self.assertEqual(status['stall'], {'empty_team': 12})
|
||||||
|
|
||||||
|
def test_occasional_check_is_not_a_stall(self):
|
||||||
|
status = self.status_while_running(3)
|
||||||
|
self.assertEqual(status['state'], 'running')
|
||||||
|
self.assertNotIn('stall', status)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user