Bug 107959
| Summary: | NRWT should set TMPDIR and delete it after DRT has finished | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Tony Chang <tony> |
| Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | alancutter, dpranke, eric |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Tony Chang
Chromium's DRT can leak files in /tmp if it crashes during a run.
A workaround was added on the bots in bug 107905 to clean up /tmp.
Instead, what we could do is set the TMPDIR environment variable for each DRT process and delete that directory when NRWT is finished (and/or when NRWT starts).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Eric Seidel (no email)
webkitpy can set this in setup_environ_for_server:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py#L876
Tony Chang
On bug 107905, eric said:
> Yeah, I briefly considered this, but wasn't sure how well the TMPDIR environment variable would be support by all the code we care about. :) I'm sure some parts hard-code /tmp.
It's probably rare in the Chromium code to hard code /tmp since that wouldn't work on Windows.
To clarify, setting TMPDIR will work on Linux only. On Windows, we would have to set TEMP, on OSX, I'm not sure. This code is controlled by the GetTempDir functions in chromium's base:
http://git.chromium.org/gitweb/?p=chromium/chromium.git;a=blob;f=base/file_util_posix.cc;h=0ffa6247a2f048b8039161d8eaf56e9d55097505;hb=HEAD#l921
http://git.chromium.org/gitweb/?p=chromium/chromium.git;a=blob;f=base/file_util_mac.mm;h=0638167b77d22d840e35176c2ff603bee277f75c;hb=HEAD#l18
http://git.chromium.org/gitweb/?p=chromium/chromium.git;a=blob;f=base/file_util_win.cc;h=2fd2399aa6391c2021edba9336ed89b7aa624d3c;hb=HEAD#l305
Alan Cutter
This is a great solution idea.
We could go a step further and have NRWT fail the patch if too many temp files are left behind so leaks of this kind are caught automatically.