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

Cur*_*ous 6 bazel

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

有没有一种方法可以在bazel命令行上提供一个自定义的超时(例如10秒),以便在测试挂起时更快地终止测试?

Ond*_* K. 6

我希望我不会误解这个问题,但这听起来确实像您在寻找--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.
Run Code Online (Sandbox Code Playgroud)

如果您想每次都使用相同的选项,则可以使用bazelrc节省一些键入时间