Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify custom timeout for bazel test

Tags:

bazel

bazel test command uses default timeout of 75 seconds for tests tagged size = small in my setup (version 0.12.0) (while the documentation mentions this as 60 seconds)

Is there a way to supply a custom timeout say 10 seconds, on bazel command line, so that if a test hangs it is terminated quicker?

like image 223
Curious Avatar asked Jun 15 '18 14:06

Curious


1 Answers

I hope I did not misread the question, but this really sounds like you're looking for --test_timeout option:

  --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.

If you want to use the same option(s) every time, you can save yourself some typing by using bazelrc.

like image 138
Ondrej K. Avatar answered Sep 18 '22 13:09

Ondrej K.