[wpt-sync] Sync PR 18341 - [ci] Correct file management in tests
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: mozilla.org, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 18341 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/18341
Details from upstream follow.
Mike Pennisi <mike@mikepennisi.com> wrote:
[ci] Correct file management in tests
The
mkstemp
function creates a file and opens that file [1], so these
tests erroneously attempted to delete an open file. This mistake was not
identified during development or automated testing because it only leads
to a runtime exception in Windows environments [2].Refactor the helper function to close the file immediately after writing
to it.[1] >
mkstemp()
returns a tuple containing an OS-level handle to an
> open file (as would be returned byos.open()
) and the absolute
> pathname of that file, in that order.https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp
[2] > On Windows, attempting to remove a file that is in use causes an
> exception to be raised; on Unix, the directory entry is removed
> but the storage allocated to the file is not made available until
> the original file is no longer in use.https://docs.python.org/2/library/os.html#os.remove
This resolves gh-18255.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Pushed to try https://treeherder.mozilla.org/#/jobs?repo=try&revision=b7440abfd9dd135c67de7e3ebef5b847ea8c0234
Assignee | ||
Comment 2•5 years ago
|
||
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Assignee | ||
Comment 3•5 years ago
|
||
Result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/d8ec210f26bd [wpt PR 18341] - [ci] Correct file management in tests, a=testonly
Comment 5•5 years ago
|
||
bugherder |
Description
•