Skip to content

Run the WASI testsuite on the host file system - #285

Draft
andreaTP wants to merge 5 commits into
bytecodealliance:mainfrom
andreaTP:wasi-host-fs-tests
Draft

andreaTP wants to merge 5 commits into
bytecodealliance:mainfrom
andreaTP:wasi-host-fs-tests

Conversation

@andreaTP

@andreaTP andreaTP commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

The WASI testsuite only ran on ZeroFs, so differences of the JDK's default file system on each OS went unnoticed (#274, #280). This also runs it on a JUnit @TempDir of the host file system.

  • wasi-test-gen-plugin gets a hostFileSystem option that generates SuiteTestsuiteHostTest, with the same tests as the ZeroFs suite, through WasiTestRunner.executeOnHost.
  • wasi-tests enables it on JDK 25 and later: older JDKs cannot set file times with nanosecond precision (JDK 11 for files, JDK 17 and 21 for symlinks on Linux), which the testsuite checks.
  • On Windows the runner sets the testsuite's NO_RENAME_DIR_TO_EMPTY_DIR and skips path_link, as Java does not expose Windows file IDs and hard links get different inode numbers.
  • The filestat test from wasi: read file stats without the "unix" attribute view #282 now also runs on a host directory.

Fixes found by the new suite:

  • Renaming a directory onto a non-empty directory returned EIO instead of ENOTEMPTY on the default file system.
  • Creating a file with O_CREAT failed with EACCES when the preopened directory is reached through a symlink, as with /tmp on macOS or the short temp path on Windows.

The first commit is #283, needed for the Windows run; it drops out on rebase once #283 is merged.

@andreaTP

andreaTP commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

FYI @JosepMariaBlasco I'm trying to cover the testing gap here, let see how deep is the rabbit hole 😅

@JosepMariaBlasco

Copy link
Copy Markdown
Contributor

Thanks, happy to run our Windows checks against it when it’s ready.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants