DescriptionFix 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 #
Messages
Total messages: 10 (0 generated)
|