gpt4 book ai didi

git - 使用 git 进行压力测试

转载 作者:太空狗 更新时间:2023-10-29 13:59:09 26 4
gpt4 key购买 nike

我有一个监控各种 git 流量的应用程序。问题是我只准备处理某些事件,如提交、分支创建/删除、标签创建/删除和注释,但 git 可以处理很多其他奇怪的情况。

有没有人知道任何类似对各种 git commit 交互的全面测试的东西,可以用来对旨在监控 git 流量的应用程序进行压力测试?

最佳答案

a thorough test of a large variety of git commit interactions

git/git/t 包括大量测试,其中一些可以用作集成到压力测试中的起点。

那 ' t ' 文件夹很有趣,因为它涵盖了所有 git 情况。


有趣的是,Git 2.21(2019 年第一季度)添加了使用“--stress”选项在负载下重复运行的功能。

参见 commit fb7d1e3 , commit fa84058 , commit 61f292d , commit 62c379b , commit 8cf5800 , commit a9b2db3 , commit 0a97e86 (2019 年 1 月 5 日),和 commit d45cec4 (2018 年 12 月 30 日)SZEDER Gábor ( szeder ) .
(由 Junio C Hamano -- gitster -- merge 于 commit 3fe47ff ,2019 年 1 月 18 日)

test-lib: add the '--stress' option to run a test repeatedly under load

Unfortunately, we have a few flaky tests, whose failures tend to be hard to reproduce.

We've found that the best we can do to reproduce such a failure is to run the test script repeatedly while the machine is under load, and wait in the hope that the load creates enough variance in the timing of the test's commands that a failure is eventually triggered.
I have a command to do that, and I noticed that two other contributors have rolled their own scripts to do the same, all choosing slightly different approaches.

To help reproduce failures in flaky tests, introduce the '--stress' option to run a test script repeatedly in multiple parallel jobs until one of them fails, thereby using the test script itself to increase the load on the machine.

The number of parallel jobs is determined by, in order of precedence:

  • the number specified as '--stress=<N>', or
  • the value of the GIT_TEST_STRESS_LOAD environment variable, or
  • twice the number of available processors (as reported by the 'getconf' utility), or 8.

Make '--stress' imply '--verbose -x --immediate' to get the most information about rare failures; there is really no point in spending all the extra effort to reproduce such a failure, and then not know which command failed and why.

关于git - 使用 git 进行压力测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37950147/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com