bazelbuild / bazelbuild/bazel

Parameter --test_timeout is ignored by the test timeout related warnings

Open
#12,411 1 comment 2 reactions 1 assignee Assigned to @meteorcloudy View on GitHub
not stale team-Core type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the problem / feature request:

Paremeter --test_timeout allows overriding default timeout for the tests. Unfortunately Bazel warnings related to test timeouts still use defaults instead of the specified override.

### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Repro is shared [here](https://github.com/Bazel-snippets/test_timeout). It is a trivial cc_test rule which runs for 70 seconds. It should be longer than the default timeout for the "short" test which is 60 seconds.
Command line: `bazel test sample --test_timeout=80 --nocache_test_results --test_verbose_timeout_warnings`

The output is `WARNING: //:sample: Test execution time (70.1s excluding execution overhead) outside of range for SHORT tests. Consider setting timeout="moderate" or size="medium".`

So despite we explicitly set "short" test timeout to 80 seconds the warning still complains about the test is longer than 60 seconds default.

--test_timeout can also be specified as `80,-1,-1,-1` - it does not change anything.

Also, I cannot help noticing that when the timeout is shortened and the test now fails because of it - as long as the cached test result is used it is still considered PASSED despite it took longer than the new timeout for the test to pass.

### What operating system are you running Bazel on?

Windows, Linux, Mac.

### What's the output of `bazel info release`?

3.7.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.