Improve temp dir handling for child procs on Windows.
Tests may leak files/directories in temp due to ScopedTempDir lifetime issues (see linked bug) or as a result of crashes. This CL augments the TestLauncher to handle such leaks a bit better. When launching a child proc on Windows, the TestLauncher now directs that child to its own dedicated temporary directory. Upon child exit, the launcher checks for leaked files/directories in that dir and deletes the dir. On test iteration completion, the launcher will emit a list of the tests that produced leaks when run with --test-launcher-print-temp-leaks that looks a lot like this: ERROR: 2 files and/or directories were left behind in the temporary directory by one or more of these tests: PaymentManagerTest.ClearPaymentInstruments:PermissionControllerImplTest.ResettingOverridesForwardsReset:PermissionControllerImplTest.SettingOverridesForwardsUpdates:PermissionControllerImplTest.RequestPermissionsDelegatesIffMissingOverrides:PermissionControllerImplTest.GetPermissionStatusDelegatesIffNoOverrides:PermissionControllerImplTest.GetPermissionStatusForFrameDelegatesIffNoOverrides:PermissionControllerImplTest.NotifyChangedSubscriptionsCallsOnChangeOnly:PermissionControllerImplTest.PermissionsCannotBeOverriddenIfNotOverridable:PermissionControllerImplTest.GrantPermissionsReturnsStatusesBeingSetIfOverridable:PictureInPictureServiceImplTest.EnterPictureInPicture Curious developers can binary search in that short list of tests to find the one(s) that are leaking and clean them up. This is a reland of https://crrev.com/728475 with macOS support disabled and a new unit test. BUG=546640 Change-Id: I93bef02a6282476b968ebd3938bc4d07357b88d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1991565 Auto-Submit: Greg Thompson <grt@chromium.org> Commit-Queue: Scott Violet <sky@chromium.org> Reviewed-by:Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#729785}
Showing
This diff is collapsed.
Please register or sign in to comment