如何为bazel test

时间:2018-06-15 14:20:51

标签: bazel

bazel test命令在我的设置(版本0.12.0)中使用标记size = small的测试使用默认超时75秒(而documentation提到此为60秒)

有没有办法在bazel命令行上提供10秒的自定义超时,这样如果测试挂起,它会更快终止?

1 个答案:

答案 0 :(得分:3)

我希望我没有误解这个问题,但这听起来好像你正在寻找--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为自己节省一些打字。