Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 2663183003: Make sure tests delete temp files on Windows (Closed)

Created:
3 years, 10 months ago by Tomasz Moniuszko
Modified:
3 years, 10 months ago
CC:
chromium-reviews, vmpstr+watch_chromium.org, phajdan, grt (UTC plus 2)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make sure tests delete temp files on Windows BUG=671990

Patch Set 1 #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -4 lines) Patch
M base/test/launcher/test_launcher.cc View 3 chunks +53 lines, -4 lines 9 comments Download

Messages

Total messages: 10 (3 generated)
Tomasz Moniuszko
phajdan.jr@ With this CL applied base::DeleteFile() no longer fails when test process is removing temporary ...
3 years, 10 months ago (2017-01-31 14:51:51 UTC) #3
Paweł Hajdan Jr.
https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc File base/test/launcher/test_launcher.cc (right): https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc#newcode60 base/test/launcher/test_launcher.cc:60: #include <limits> nit: Include system headers before chromium headers ...
3 years, 10 months ago (2017-02-01 11:10:48 UTC) #4
grt (UTC plus 2)
https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc File base/test/launcher/test_launcher.cc (right): https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc#newcode363 base/test/launcher/test_launcher.cc:363: since the problem is that new_options.stdout_handle is inherited into ...
3 years, 10 months ago (2017-02-01 13:04:44 UTC) #5
Tomasz Moniuszko
https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc File base/test/launcher/test_launcher.cc (right): https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc#newcode175 base/test/launcher/test_launcher.cc:175: // Does the same as base::ReadFileToString() but uses FILE_SHARE_DELETE ...
3 years, 10 months ago (2017-02-02 16:16:44 UTC) #6
grt (UTC plus 2)
The behavior I noticed when I filed the bug was that these tmp files were ...
3 years, 10 months ago (2017-02-03 09:53:23 UTC) #8
Tomasz Moniuszko
https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc File base/test/launcher/test_launcher.cc (right): https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_launcher.cc#newcode363 base/test/launcher/test_launcher.cc:363: On 2017/02/03 09:53:23, grt (UTC plus 1) wrote: > ...
3 years, 10 months ago (2017-02-03 10:08:49 UTC) #9
grt (UTC plus 2)
3 years, 10 months ago (2017-02-03 12:45:18 UTC) #10
https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_lau...
File base/test/launcher/test_launcher.cc (right):

https://codereview.chromium.org/2663183003/diff/1/base/test/launcher/test_lau...
base/test/launcher/test_launcher.cc:363: 
On 2017/02/03 10:08:48, Tomasz Moniuszko wrote:
> On 2017/02/03 09:53:23, grt (UTC plus 1) wrote:
> > On 2017/02/02 16:16:43, Tomasz Moniuszko wrote:
> > > On 2017/02/01 13:04:44, grt (UTC plus 1) wrote:
> > > > since the problem is that new_options.stdout_handle is inherited into
> every
> > > > subproc, another approach is to revoke that handle's ability to be
> inherited
> > > > here just after the correct subprocess was launched. this is a bit
hacky,
> > but
> > > > something like:
> > > > 
> > > >     if (new_options.stdout_handle) {
> > > >       // Prevent leakage of this handle into other subprocs.
> > > >       ::SetHandleInformation(new_options.stdout_handle,
> HANDLE_FLAG_INHERIT,
> > > >                              0);
> > > >     }
> > > 
> > > It doesn't seem to work.
> > 
> > Did you try it without your other changes? I just tried locally and it
seemed
> to
> > work as desired.
> > 
> > > I added the above code to
> > > LaunchChildTestProcessWithOptions(). I'm still getting "Failed to delete"
> > > warning from DoLaunchChildTestProcess(). Some temp files still stay in
temp
> > > folder when test is finished. Also test process no longer prints
information
> > > about failed test (for example when one of EXPECT_ gtest expectations
> fails).
> > > Parent process just prints names of failed tests in the summary.
> > 
> 
> Yes, I did it on clean master. I used gpu_unittests for testing (I noticed
that
> these tests leave temp files almost every run).
> 
> Maybe I put the above code in the wrong place. Your fix is indeed much easier
> than the solution I uploaded. I will close this review if your fix solves the
> issue.

This almost fixes it: https://codereview.chromium.org/2670213004/. See the CL
description for a taste of how tricky this is. I'll send up another CL to fix
base::OpenFile. Cheers.

Powered by Google App Engine
This is Rietveld 408576698