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

Issue 179253002: Fix resource leak (temporary files and directories) in run-bindings-tests (Closed)

Created:
6 years, 10 months ago by Nils Barth (inactive)
Modified:
6 years, 10 months ago
Reviewers:
haraken
CC:
blink-reviews, Dirk Pranke, scottmg, iannucci, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fix resource leak (temporary files and directories) in run-bindings-tests run-bindings-tests is leaking files and directories on Windows, breaking the Windows try bot. This CL fixes it. In Python, resources should be managed with the 'with' statement, with resources released in __exit__ methods. Using __del__ statements and scope does not work, as __del__ is not guaranteed to be called. run-bindings-tests uses a class, ScopedTempFileProvider, whose resources are incorrectly managed with __del__, hence the problem. References: [blink-dev] RFC: simplifying Blink CQ, switching fully to SimpleTryJobVerifier https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/5ArYZHC_QR8 https://groups.google.com/a/chromium.org/d/msg/blink-dev/5ArYZHC_QR8/NmFQZrkAlYUJ http://docs.python.org/2/reference/datamodel.html#object.__del__ "It is not guaranteed that__del__() methods are called for objects that still exist when the interpreter exits." With Statement: http://docs.python.org/2/reference/compound_stmts.html#with http://docs.python.org/2/reference/datamodel.html#with-statement-context-managers Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167773

Patch Set 1 #

Patch Set 2 : Reupload #

Total comments: 3

Patch Set 3 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -41 lines) Patch
M Tools/Scripts/run-bindings-tests View 2 chunks +5 lines, -7 lines 0 comments Download
M Tools/Scripts/webkitpy/bindings/main.py View 1 2 6 chunks +49 lines, -34 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Nils Barth (inactive)
Fix to (one) of the Windows try bot issues!
6 years, 10 months ago (2014-02-25 01:37:26 UTC) #1
haraken
LGTM https://codereview.chromium.org/179253002/diff/20001/Tools/Scripts/webkitpy/bindings/main.py File Tools/Scripts/webkitpy/bindings/main.py (right): https://codereview.chromium.org/179253002/diff/20001/Tools/Scripts/webkitpy/bindings/main.py#newcode69 Tools/Scripts/webkitpy/bindings/main.py:69: self.dir_paths = [] Instead of managing all file ...
6 years, 10 months ago (2014-02-25 01:45:12 UTC) #2
Nils Barth (inactive)
https://codereview.chromium.org/179253002/diff/20001/Tools/Scripts/webkitpy/bindings/main.py File Tools/Scripts/webkitpy/bindings/main.py (right): https://codereview.chromium.org/179253002/diff/20001/Tools/Scripts/webkitpy/bindings/main.py#newcode69 Tools/Scripts/webkitpy/bindings/main.py:69: self.dir_paths = [] On 2014/02/25 01:45:13, haraken wrote: > ...
6 years, 10 months ago (2014-02-25 01:49:03 UTC) #3
Nils Barth (inactive)
The CQ bit was checked by nbarth@chromium.org
6 years, 10 months ago (2014-02-25 01:49:16 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/179253002/40001
6 years, 10 months ago (2014-02-25 01:49:25 UTC) #5
Nils Barth (inactive)
https://codereview.chromium.org/179253002/diff/20001/Tools/Scripts/webkitpy/bindings/main.py File Tools/Scripts/webkitpy/bindings/main.py (right): https://codereview.chromium.org/179253002/diff/20001/Tools/Scripts/webkitpy/bindings/main.py#newcode69 Tools/Scripts/webkitpy/bindings/main.py:69: self.dir_paths = [] Actually, Terry is fixing r-b-t so ...
6 years, 10 months ago (2014-02-25 01:57:57 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/179253002/40001
6 years, 10 months ago (2014-02-25 05:19:27 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/179253002/40001
6 years, 10 months ago (2014-02-25 07:41:16 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nbarth@chromium.org/179253002/40001
6 years, 10 months ago (2014-02-25 13:25:12 UTC) #9
commit-bot: I haz the power
6 years, 10 months ago (2014-02-25 14:36:54 UTC) #10
Message was sent while issue was closed.
Change committed as 167773

Powered by Google App Engine
This is Rietveld 408576698