Closed Bug 1574533 Opened 5 months ago Closed 5 months ago

[wpt-sync] Sync PR 18341 - [ci] Correct file management in tests


(Testing :: web-platform-tests, task, P4)



(firefox70 fixed)

Tracking Status
firefox70 --- fixed


(Reporter: wptsync, Unassigned)




(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 18341 into mozilla-central (this bug is closed when the sync is complete).

Details from upstream follow.

Mike Pennisi <> 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 by and the absolute
> pathname of that file, in that order.

[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.

This resolves gh-18255.

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Result changes from PR not available.
Pushed by
[wpt PR 18341] - [ci] Correct file management in tests, a=testonly
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.