test: update `FileAPI` wpt
git node wpt FileAPI
Note one new failure:
Passing a Float16Array as element of the blobParts array should work.
Note that several tests now pass that previously failed.
Review requested:
- [ ] @nodejs/web-standards
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.40%. Comparing base (
89a2f56) to head (b1c015c). Report is 1252 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #55194 +/- ##
==========================================
+ Coverage 88.39% 88.40% +0.01%
==========================================
Files 652 652
Lines 186565 186565
Branches 36046 36038 -8
==========================================
+ Hits 164916 164936 +20
+ Misses 14908 14902 -6
+ Partials 6741 6727 -14
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
CI: https://ci.nodejs.org/job/node-test-pull-request/63173/
Seemingly related test failures:
[EXPECTED_FAILURE][FAIL] Getters and value conversions should happen in order until an exception is thrown.
assert_array_equals: lengths differ, expected array ["Symbol.iterator", "length getter", "length valueOf", "0 getter", "0 toString", "length getter", "length valueOf", "1 getter"] length 8, got ["Symbol.iterator", "Symbol.iterator", "length getter", "length valueOf", "0 getter", "0 toString", "length getter", "length valueOf", "1 getter"] length 9
at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js:179:3)
at Test.step (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/resources/testharness.js:2599:25)
at test (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/resources/testharness.js:628:30)
at /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js:142:1
at Script.runInThisContext (node:vm:137:12)
Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
[PASS] ToString should be called on elements of the blobParts array and any exceptions should be propagated.
[EXPECTED_FAILURE][FAIL] options properties should be accessed in lexicographic order.
assert_array_equals: expected property 0 to be "endings" but got "type" (expected array ["endings", "type"] got ["type", "endings"])
at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js:398:3)
at Test.step (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/resources/testharness.js:2599:25)
at test (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/resources/testharness.js:628:30)
at /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js:386:1
at Script.runInThisContext (node:vm:137:12)
Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
[EXPECTED_FAILURE][FAIL] Arguments should be evaluated from left to right.
assert_unreached: type getter should not be called. Reached unreachable code
at get type (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js:407:22)
at new Blob (node:internal/blob:152:7)
at /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js:404:5
at assert_throws_exactly_impl (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/resources/testharness.js:2332:18)
at assert_throws_exactly (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/resources/testharness.js:2319:9)
Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
[PASS] Passing 123 for options should throw
[PASS] Passing 123.4 for options should throw
[PASS] Passing true for options should throw
[PASS] Passing "abc" for options should throw
[PASS] Blob with type ""
[PASS] Blob with type "a"
[PASS] Blob with type "A"
[PASS] Blob with type "text/html"
[PASS] Blob with type "TEXT/HTML"
[PASS] Blob with type "text/plain;charset=utf-8"
[PASS] Blob with type "å"
[PASS] Blob with type "𐑾"
[PASS] Blob with type " image/gif "
[PASS] Blob with type "\timage/gif\t"
[PASS] Blob with type "image/gif;"
[PASS] Blob with type "İmage/gif"
[PASS] Blob with type "ımage/gif"
[PASS] Blob with type "image/gif\0"
[PASS] Blob with type "unknown/unknown"
[PASS] Blob with type "text/plain"
[PASS] Blob with type "image/png"
[PASS] A plain object with @@iterator should be treated as a sequence for the blobParts argument.
[PASS] A plain object with @@iterator and a length property should be treated as a sequence for the blobParts argument.
[PASS] A String object should be treated as a sequence for the blobParts argument.
[PASS] A Uint8Array object should be treated as a sequence for the blobParts argument.
[PASS] Changes to the blobParts array should be reflected in the returned Blob (pop).
[PASS] Changes to the blobParts array should be reflected in the returned Blob (unshift).
[PASS] ToString should be called on elements of the blobParts array.
[PASS] ArrayBuffer elements of the blobParts array should be supported.
[UNEXPECTED_FAILURE][FAIL] Passing typed arrays as elements of the blobParts array should work.
assert_equals: expected "PASSPASSPASSPASSPASSPASSPASS" but got "PASSPASSAPSSAPSSSSAPSSAPSSAP"
at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/support/Blob.js:16:5)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
[EXPECTED_FAILURE][FAIL] Passing a Float16Array as element of the blobParts array should work.
promise_test: Unhandled rejection with value: object "ReferenceError: Float16Array is not defined"
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
[UNEXPECTED_FAILURE][FAIL] Passing a Float64Array as element of the blobParts array should work.
assert_equals: expected "PASSPASS" but got "SSAPSSAP"
at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/support/Blob.js:16:5)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
I can't reproduce the failures locally
Removing [EXPECTED_FAILURE] and [PASS]:
Seemingly related test failures:
[UNEXPECTED_FAILURE][FAIL] Passing typed arrays as elements of the blobParts array should work. assert_equals: expected "PASSPASSPASSPASSPASSPASSPASS" but got "PASSPASSAPSSAPSSSSAPSSAPSSAP" at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/support/Blob.js:16:5) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js' ... [UNEXPECTED_FAILURE][FAIL] Passing a Float64Array as element of the blobParts array should work. assert_equals: expected "PASSPASS" but got "SSAPSSAP" at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/support/Blob.js:16:5) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
These look very much like endianness issues, especially since they're failing on AIX and LinuxONE which are both big endian platforms.
I don't have a big endian machine to test this one, but it's likely, there may be a bug :thinking:. Drafting until whatever this is is resolved.
I don't have a big endian machine to test this one, but it's likely, there may be a bug 🤔. Drafting until whatever this is is resolved.
I think it's a bug in WPT. Taking, for example, https://github.com/nodejs/node/blob/b1c015cc9b56f004362398567e708c7aecb65be4/test/fixtures/wpt/FileAPI/blob/Blob-constructor.any.js#L285-L299 Typed arrays are by definition
Typed arrays always use the platform's native byte order.
which means, e.g. that the bytes for new Uint16Array([0x4150, 0x5353]) will be different on little endian vs big endian platforms.
This is a bug in node. I will give some more context in a little bit.
I forgot to follow up, but here are the steps (this follows through multiple specs so I will link each one).
- The Blob constructor calls process blob parts.
process blob partscalls get a copy of the bytes held by the buffer source- which calls GetValueFromBuffer for each element in a webidl BufferSource (a TypedArray, DataView, or ArrayBuffer)
- which calls RawBytesToNumeric (note the
isLittleEndianflag - which is where we FINALLY get the step
- If isLittleEndian is false, reverse the order of the elements of rawBytes.
Thanks for the details! I'll update these files later today, and if this is still the case, I'll open an issue in the WPT repository
Thanks for the details! I'll update these files later today, and if this is still the case, I'll open an issue in the WPT repository
@KhafraDev 's analysis is that this is a Node.js bug, not a WPT one.
Oh, I misunderstood. Got it, keeping this is a draft until that's fixed