Test rule is SIGKILL-ed after timeout instead of waiting for the termination grace period
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 72
Description
### Description of the problem / feature request:
Tests that exceed the timeout are sent a SIGKILL signal without waiting for the termination grace period to pass. I observed this for Golang and Kotlin tests, it however works as expected for shell tests.
### Feature requests: what underlying problem are you trying to solve with this feature?
Test cleanup.
### Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I reproduced it in https://github.com/dejan-lokar/bazel-termination-grace with a Golang and a Shell test. I run both tests with 3s timeout and an additional 3s for graceful termination. Shell test exits after ~6s as expected, Golang test however exists after ~3s.
```
bazel test --test_output=streamed --cache_test_results=no --test_timeout=3 --local_termination_grace_seconds=3 //:sh_test
//:sh_test TIMEOUT in 6.0s
```
```
bazel test --test_output=streamed --cache_test_results=no --test_timeout=3 --local_termination_grace_seconds=3 //:go_test
//:go_test TIMEOUT in 3.0s
```
### What operating system are you running Bazel on?
macOS Big Sur, Version 11.5.2
### What's the output of `bazel info release`?
release 4.2.1
### What's the output of `git remote get-url origin ; git rev-parse master ; git rev-parse HEAD` ?
git@github.com:dejan-lokar/bazel-termination-grace.git
d21375a86f0179f20d9fd11ac643366c608ff0a5
d21375a86f0179f20d9fd11ac643366c608ff0a5
### Have you found anything relevant by searching the web?
This closed issue appears related: https://github.com/bazelbuild/bazel/issues/7119. If I add a `--experimental_split_xml_generation` flag, the Golang test still timeout-s at ~3s.
Contributor guide
Research direction
Start by running the linked bazel-termination-grace reproduction with //:go_test and //:sh_test, using --test_timeout=3 and --local_termination_grace_seconds=3. Compare the termination behavior and trace the test execution path responsible for the difference. Done means the Go and Kotlin cases wait through the configured grace period like the shell test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java, kotlin, shell
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100