Skip to content

test: handle host endianness in FileAPI Blob WPT tests - #66771

Closed
abhayagarwal-dev wants to merge 1 commit into
nodejs:mainfrom
abhayagarwal-dev:fix-wpt-fileapi-big-endian
Closed

abhayagarwal-dev wants to merge 1 commit into
nodejs:mainfrom
abhayagarwal-dev:fix-wpt-fileapi-big-endian

Conversation

@abhayagarwal-dev

Copy link
Copy Markdown

Description

ECMAScript TypedArrays store elements using host-native byte order. On big-endian architectures (such as IBM s390x / LinuxONE and AIX ppc64), TypedArray byte layouts differ from little-endian platforms, causing Blob-constructor.any.js subtests to fail when passing multi-byte TypedArrays (Uint16Array, Uint32Array, Float16Array, Float64Array, BigInt64Array).

This PR:

  1. Updates the Blob-constructor.any.js WPT fixture with runtime host endianness detection (isLittleEndian) and adjusts the expected values so the subtests pass on both little-endian and big-endian systems.
  2. Updates test/wpt/status/FileAPI/blob.cjs to remove the temporary os.endianness() === 'BE' expected failure entries, as the tests now pass cleanly across all supported architectures.

Test

Before (in Big-Endian machine):

    [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'
    Files: 2/2 ran, 0 passed, 0 skipped, 0 expected failures, 2 unexpected failures, 0 unexpected passes
Subtests: 138 passed, 0 skipped, 0 expected failures, 8 unexpected failures, 0 unexpected passes

After(In Big-Endian machine):

Files: 2/2 ran, 2 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes
Subtests: 146 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes

References

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/web-standards

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure. labels Oct 15, 2026
@panva

panva commented Oct 15, 2026

Copy link
Copy Markdown
Member

Thank you for contributing this upstream. We'll run a WPT update worfklow for getting this updated in our repo instead.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.50%. Comparing base (1c90519) to head (4c0d76d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66771   +/-   ##
=======================================
  Coverage   90.49%   90.50%           
=======================================
  Files         797      797           
  Lines      277598   277598           
  Branches    53336    53336           
=======================================
+ Hits       251220   251245   +25     
+ Misses      16790    16774   -16     
+ Partials     9588     9579    -9     

see 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to Node.js core tests and test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants