Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child process watchdog for tests #1555

Closed
int19h opened this issue Jul 2, 2019 · 0 comments

Comments

Projects
None yet
3 participants
@int19h
Copy link
Contributor

commented Jul 2, 2019

Issues like #1552 can be hard to diagnose, because unrelated tests fail because ptvsd from an older failed test is still around. We need some way to clean those up, so that test reports only contain relevant failures.

We have previously done so by using a process watchdog - in fact, it is still there in watchdog.py. The idea is to have a process external to the test worker, which monitors said worker, and kills any debuggee processes that are left around after the worker exits.

This worked, but we disabled it for perf reasons. It was a naive implementation that used one watchdog per DebugSession instance. A full test run thus resulted in accumulation of hundreds of those processes, all watching the same test worker, causing OOM issues.

We need to fix the watchdog such that it's a single process per test worker. The watchdog should communicate with the test worker and receive PIDs for new child processes spawned by debug.Session (e.g. over stdin), and clean them all up once the worker exits.

@int19h int19h added the Test-issue label Jul 2, 2019

@karthiknadig karthiknadig added this to the Jun 2019.2 milestone Jul 2, 2019

@gramster gramster modified the milestones: Jun 2019.2, Jul 2019.1 Jul 10, 2019

@int19h int19h self-assigned this Jul 12, 2019

int19h added a commit to int19h/ptvsd that referenced this issue Jul 15, 2019

Fix microsoft#1555: Child process watchdog for tests
Implement per-test-runner out-of-process watchdog for processes spawned by tests.

Add file logging for tests and watchdog.

Improve stdio capture in debug.Session when test fails.

Remove redundant logging in debug.Session.

int19h added a commit that referenced this issue Jul 18, 2019

Fix #1555: Child process watchdog for tests
Implement per-test-runner out-of-process watchdog for processes spawned by tests.

Add file logging for tests and watchdog.

Improve stdio capture in debug.Session when test fails.

Remove redundant logging in debug.Session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.