tests: ensure all profiler-spawned processes go down if gProfiler is brutally killed
- Dominant language
- Python
- Stars
- 826
- Forks
- 79
- PR merge metrics
- No merged PRs in 30d
Description
When stopped gracefully, gProfiler will ask all child processes to go down, and wait until they do; so once gProfiler exited, we no long have perfs/pyperf/phpspy etc.
When gProfiler is killed brutally (e.g `kill -9`), it cannot ask the childs to go down. We utilize a Linux feature called `PDEATHSIG`. It was added in https://github.com/Granulate/gprofiler/pull/247. I'd like to add automatic tests for this feature -
* The tests need to run gProfiler exe & not container, because once gProfiler in a container is killed, the container exits and all other processes are killed automatically. The case we're testing is exe therefore.
* The test can run gProfiler exe in a clean container.
* `kill -9` it and ensure that no processes remain in the container besides e.g a `bash` which has started the profiler exe.
* The test should ensure that gProfiler was indeed brutally killed - i.e, no cleanups were performed, the process exited with `SIGKILL` exit code, the temporary directory at `/tmp/gprofiler_tmp/tmpxxxxx` remains on the filesystem.
Contributor guide
Assessment
This issue has not been assessed yet.