CI failed on Windows

未关闭
#97 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python
领域
testing-qa

调研方向

先从 pyperf/tests/test_perf_cli.py 和 pyperf/tests/test_timeit.py 中失败的测试开始,然后复现 Windows CI 失败。根据堆栈跟踪追踪报告的 RSS 和 timeit 子进程错误。在不改变这三个测试预期行为的情况下使其在 Windows 上通过,即表示完成。

由索引模型根据 Issue 内容生成。

描述

======================================================================
FAIL: test_command_track_memory (test_perf_cli.TestPerfCLI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\pyperf\pyperf\pyperf\tests\test_perf_cli.py", line 619, in test_command_track_memory
    self.run_command(*args)
  File "D:\a\pyperf\pyperf\pyperf\tests\test_perf_cli.py", line 35, in run_command
    self.assertEqual(proc.stderr, '')
AssertionError: 'Traceback (most recent call last):\n  Fil[2698 chars] 1\n' != ''
- Traceback (most recent call last):
-   File "c:\hostedtoolcache\windows\python\3.9.2\x64\lib\runpy.py", line 197, in _run_module_as_main
-     return _run_code(code, main_globals, None,
-   File "c:\hostedtoolcache\windows\python\3.9.2\x64\lib\runpy.py", line 87, in _run_code
-     exec(code, run_globals)
-   File "D:\a\pyperf\pyperf\pyperf\__main__.py", line 763, in <module>
-     main()
-   File "D:\a\pyperf\pyperf\pyperf\__main__.py", line 759, in main
-     func()
-   File "D:\a\pyperf\pyperf\pyperf\__main__.py", line 728, in cmd_bench_command
-     runner.bench_command(name, command)
-   File "D:\a\pyperf\pyperf\pyperf\_runner.py", line 622, in bench_command
-     return self._main(task)
-   File "D:\a\pyperf\pyperf\pyperf\_runner.py", line 427, in _main
-     bench = self._worker(task)
-   File "D:\a\pyperf\pyperf\pyperf\_runner.py", line 401, in _worker
-     run = task.create_run()
-   File "D:\a\pyperf\pyperf\pyperf\_worker.py", line 284, in create_run
-     self.compute()
-   File "D:\a\pyperf\pyperf\pyperf\_command.py", line 53, in compute
-     raise RuntimeError("failed to get the process RSS")
- RuntimeError: failed to get the process RSS
- Traceback (most recent call last):
-   File "c:\hostedtoolcache\windows\python\3.9.2\x64\lib\runpy.py", line 197, in _run_module_as_main
-     return _run_code(code, main_globals, None,
-   File "c:\hostedtoolcache\windows\python\3.9.2\x64\lib\runpy.py", line 87, in _run_code
-     exec(code, run_globals)
-   File "D:\a\pyperf\pyperf\pyperf\__main__.py", line 763, in <module>
-     main()
-   File "D:\a\pyperf\pyperf\pyperf\__main__.py", line 759, in main
-     func()
-   File "D:\a\pyperf\pyperf\pyperf\__main__.py", line 728, in cmd_bench_command
-     runner.bench_command(name, command)
-   File "D:\a\pyperf\pyperf\pyperf\_runner.py", line 622, in bench_command
-     return self._main(task)
-   File "D:\a\pyperf\pyperf\pyperf\_runner.py", line 432, in _main
-     bench = self._manager()
-   File "D:\a\pyperf\pyperf\pyperf\_runner.py", line 560, in _manager
-     bench = Manager(self).create_bench()
-   File "D:\a\pyperf\pyperf\pyperf\_manager.py", line 229, in create_bench
-     worker_bench, run = self.create_worker_bench()
-   File "D:\a\pyperf\pyperf\pyperf\_manager.py", line 128, in create_worker_bench
-     suite = self.create_suite()
-   File "D:\a\pyperf\pyperf\pyperf\_manager.py", line 122, in create_suite
-     suite = self.spawn_worker(0, 0)
-   File "D:\a\pyperf\pyperf\pyperf\_manager.py", line 104, in spawn_worker
-     raise RuntimeError("%s failed with exit code %s"
- RuntimeError: D:\a\pyperf\pyperf\.tox\py\Scripts\python.EXE failed with exit code 1


======================================================================
FAIL: test_python_option (test_timeit.TestTimeit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\pyperf\pyperf\pyperf\tests\test_timeit.py", line 248, in test_python_option
    self.assertEqual(cmd.returncode, 0, repr(cmd.stdout + cmd.stderr))
AssertionError: 1 != 0 : 'Error when running timeit benchmark:\n\nStatement:\n\'time.sleep(1e-6)\'\n\nSetup:\n\'import time\'\n\nNo pyvenv.cfg file\nTraceback (most recent call last):\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_timeit.py", line 230, in bench_timeit\n    runner.bench_time_func(name, timer.time_func, **kwargs)\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_runner.py", line 462, in bench_time_func\n    return self._main(task)\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_runner.py", line 432, in _main\n    bench = self._manager()\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_runner.py", line 560, in _manager\n    bench = Manager(self).create_bench()\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_manager.py", line 229, in create_bench\n    worker_bench, run = self.create_worker_bench()\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_manager.py", line 128, in create_worker_bench\n    suite = self.create_suite()\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_manager.py", line 122, in create_suite\n    suite = self.spawn_worker(0, 0)\n  File "D:\\a\\pyperf\\pyperf\\pyperf\\_manager.py", line 104, in spawn_worker\n    raise RuntimeError("%s failed with exit code %s"\nRuntimeError: C:\\Users\\runneradmin\\AppData\\Local\\Temp\\tmpsstomtue failed with exit code 106\n'

======================================================================
FAIL: test_worker_verbose (test_timeit.TestTimeit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\pyperf\pyperf\pyperf\tests\test_timeit.py", line 107, in test_worker_verbose
    self.assertIsNotNone(match, repr(cmd.stdout))
AssertionError: unexpectedly None : "Warmup 1: 337 us (loops: 1, raw: 337 us)\n\nValue 1: 1.86 ms\nValue 2: 853 us\n\nMetadata:\n- boot_time: 2021-03-16 06:40:42.876194\n- cpu_count: 2\n- date: 2021-03-16 06:46:56.876194\n- duration: 16.0 ms\n- hostname: fv-az68-167\n- loops: 1\n- mem_peak_pagefile_usage: 9988.0 kB\n- name: timeit\n- perf_version: 2.1.1\n- platform: Windows-10-10.0.17763-SP0\n- python_compiler: MSC v.1928 64 bit (AMD64)\n- python_executable: D:\\a\\pyperf\\pyperf\\.tox\\py\\Scripts\\python.EXE\n- python_hash_seed: 337\n- python_implementation: cpython\n- python_version: 3.9.2 (64-bit) revision 1a79785\n- timeit_setup: 'import time'\n- timeit_stmt: 'time.sleep(1e-3)'\n- timer: QueryPerformanceCounter(), resolution: 100 ns\n- unit: second\n- uptime: 6 min 14.0 sec\n\nMean +- std dev: 1.36 ms +- 0.71 ms\n"

----------------------------------------------------------------------
Ran 165 tests in 18.766s

FAILED (failures=3)
ERROR: InvocationError for command 'D:\a\pyperf\pyperf\.tox\py\Scripts\python.EXE' -bb -Wd -m unittest discover -s pyperf/tests/ -v (exited with code 1)
___________________________________ summary ___________________________________
ERROR:   py: commands failed
主要语言
Python
星标
967
派生
112
平均合并
5 天 8 小时
30 天内合并 PR
9

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

psf/pyperf 的其他 Issue

查看 psf/pyperf 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。