Fix OPFS WPT WritableFileStream tests to ensure cleanups are done in the correct order
Categories
(Core :: DOM: File, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: jesup, Assigned: jesup)
References
Details
Attachments
(1 file)
WritableFileStream (and SyncAccessHandles) take locks on files. If we need to clean them up after a test failure (call close()), we need to make sure the cleanups are done in the correct order, synchronously, in order to not hit problems with locks being held when we try to delete files.
I.e. if we createEmptyFile() (which adds a cleanup to delete the file, and then CreateWritable() (which adds a cleanup to close the writable, and takes a shared lock), we need to ensure that if cleanups run, the writable is cleaned up before we try to delete the file (which takes an exclusive lock on the file).
The default test.add_cleanup() code from testharness.js in wpt executes the cleanups in parallel, and even if it wasn't in parallel it would be in FIFO order (the wrong order).
This adds an OPFS-specific cleanup queue called once from the test cleanup list, and we process the list synchronously in LIFO order.
Assignee | ||
Comment 1•2 years ago
|
||
The default test.add_cleanup() code from testharness.js in wpt executes the
cleanups in parallel, and even if it wasn't in parallel it would be in FIFO
order (the wrong order).
This adds an OPFS-specific cleanup queue called once from the test cleanup
list, and we process the list synchronously in LIFO order.
Updated•2 years ago
|
Pushed by rjesup@wgate.com: https://hg.mozilla.org/integration/autoland/rev/388419886525 Add an OPFS-specific synchronous ordered cleanup queue r=asuth,dom-storage-reviewers
Comment 3•2 years ago
|
||
bugherder |
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36182 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Description
•