代码之家  ›  专栏  ›  技术社区  ›  Curious

如何为bazel测试指定自定义超时

  •  5
  • Curious  · 技术社区  · 7 年前

    bazel test 对于标记的测试,命令使用默认超时值75秒 size = small 在我的设置中(0.12.0版)(而 documentation 将其称为60秒)

    有没有办法提供一个自定义超时,比如说10秒,打开 bazel 命令行,这样如果一个测试挂起,它会更快地终止?

    1 回复  |  直到 7 年前
        1
  •  4
  •   Ondrej K.    7 年前

    我希望我没有误读这个问题,但这听起来像是你在找的 --test_timeout 选项:

      --test_timeout
        (a single integer or comma-separated list of 4 integers; default: "-1")
        Override the default test timeout values for test timeouts (in secs). If a 
        single positive integer value is specified it will override all 
        categories.  If 4 comma-separated integers are specified, they will 
        override the timeouts for short, moderate, long and eternal (in that 
        order). In either form, a value of -1 tells blaze to use its default 
        timeouts for that category.
    

    如果每次都要使用相同的选项,可以使用 bazelrc .