bazel

What does 'tests too big' warning in bazel mean?


I frequently get this message while running bazel test //...

There were tests whose specified size is too big.   
Use the --test_verbose_timeout_warnings command line option to see which ones these are.

What does 'size is too big' mean? As in what does 'size' refer to here? And why does 'big' matter?


Solution

  • It's telling you that the declared timeout is "too long". I find it a nuisance warning and ignore it, because it's often impossible to set timeouts somewhere that doesn't trigger this warning when it's the last test running on a fast CI machine, but doesn't time out on much slower developer laptops or heavily loaded CI machines.

    The test encyclopedia gives a default mapping between sizes and timeouts, and the "recommended lower bounds" which trigger that warning. --test_timeout can modify those values. Also individual test targets can use the timeout attribute to override it.

    The wording of the message is from before timeouts were supported as a separate concept from the sizes, which also default several other job-scheduling-related values. The common rule definitions for tests docs have more details on that.