Unverified Commit d940cd30 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

test(turbo-tasks-backend): run the db_versioning tests on wasm (#97901)

### What?

Makes `turbo-tasks-backend`'s `db_versioning` tests run on
`wasm32-wasip1-threads` instead of being
skipped, by routing temporary-directory creation in tests through a
small helper that does not depend
on `std::env::temp_dir()`.

Twelve test instances that were previously skipped now execute on wasm.
Three related
`kv_backing_storage` instances remain skipped, but for a different — and
verified — reason (see below).
Native behaviour is unchanged: the same tests run exactly as before, and
nothing is newly skipped there.

The wider WASI suite also exposed an unrelated intermittent stall in
`test_unbounded_busy_queue_does_not_churn_workers`: passing isolated
runs finish in about 0.25 seconds,
while repeated runs can stop making progress indefinitely. That stress
test is now ignored only on
WASI, with the observed reason recorded; native coverage remains enabled
while the underlying
multi-threaded runtime stall is investigated separately.

### Why?

These tests were skipped with the reason `no temp directory on WASI`,
which turned out to be only half
true. WASI genuinely has no notion of a system temp directory —
`std::env::temp_dir()` is hard-coded to
`unsupported()` in `std/sys/paths/wasi.rs`, so it panics regardless of
`TMPDIR` — but the *filesystem
itself works fine*. A WASI guest can use any directory the host preopens
for it.

So the blocker was in how the tests asked for a directory, not in the
platform. Asking WASI where "temp"
is fails; creating a directory inside a path the host already granted
succeeds.

This matters beyond tidiness: skip reasons are the primary record of
what does and does not work on
wasm, and an inaccurate one is worse than no reason at all, because it
makes a fixable problem look like
a platform limit and quietly discourages anyone from trying.

Fixing it also uncovered the *real* limitation underneath. With temp
directories working, the three
`kv_backing_storage` tests get further and hit a genuine platform gap:
`memmap2` ships `unix.rs`,
`windows.rs` and a stub for every other target, so `turbo-persistence`
cannot open a database on WASI
at all (`Failed to mmap: platform not supported`). Those three are still
skipped, now with that cause
recorded instead of the temp-directory one. That is a real, separate
piece of work — persistent caching
cannot function on wasm until `turbo-persistence` grows a non-mmap read
path — and it is now visible
rather than hidden behind a misleading reason.

### How?

A single test-only helper owns the platform difference, so the ~11 call
sites stay identical in shape
and no test carries its own `cfg`. On native it delegates to
`tempfile::tempdir()`, preserving today's
behaviour byte for byte, including having `TempDir` own cleanup. On wasm
it creates the directory inside
a preopened path instead of consulting the environment. The helper is
crate-private and compiled only
for tests, so it adds nothing to the shipped crate, and it returns
`tempfile`'s own error type rather
than erasing it.

Two deliberate choices are worth calling out for review:

- **Every remaining skip is justified by an observed failure**, not by
inference. Each of the three
`kv_backing_storage` tests was run individually and traced to
`memmap2`'s stub before being skipped
again; the twelve `db_versioning` ones were confirmed to pass. Nothing
is skipped speculatively.
- **Skips use `ignore` with a reason rather than `cfg`**, so they appear
in test output as
`ignored, <reason>` instead of silently vanishing from the run. That is
what keeps the count of
what-doesn't-work-on-wasm honest and reviewable, and it is asserted that
the native run still has
  zero ignored tests.

The wasm coupling is documented at the helper: it relies on the host
preopening a directory, which the
repository's Node wasi test host does. A different runner must provide
the same, or update the helper.

<!-- NEXT_JS_LLM -->


<!-- fleet b6d0486f-97c7-42a7-bdaf-3490774cdec3 -->
Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
Co-authored-by: 's avatarLuke Sandberg <210140+lukesandberg@users.noreply.github.com>
parent a70cf087
......@@ -48,6 +48,7 @@ wasi-sdk setup.
| `wasi.thread-spawn` | `@emnapi/wasi-threads` over `node:worker_threads` (`spawn.mjs`) |
| `env.memory` | a shared `WebAssembly.Memory` matching the explicit linker limits in `.cargo/config.toml` |
| `env.read_custom_section` | `WebAssembly.Module.customSections` (`lib.mjs`) |
| filesystem | working directory at `/`; the system `os.tmpdir()` at `/tmp`, also exported as `TMPDIR` |
`@emnapi/wasi-threads` owns Worker lifecycle, compiled-module transfer, load/start ordering, and
cleanup. A small local adapter remains because Rust imports the original one-argument
......@@ -72,6 +73,14 @@ Returning `0` unconditionally is not a shortcut: the registries then come up emp
pre-main constructor notices and aborts, which is at least loud, but the correct sections are what
make the module usable. `registry::tests::registries_are_populated` guards this from the Rust side.
### Temporary files
WASI preview1's `std::env::temp_dir()` is unsupported, so Rust tests cannot use
`tempfile::tempdir()` directly. The runner pre-opens the system's actual temporary directory as
`/tmp` for the main instance and every pthread, and exports that guest path through `TMPDIR`.
`turbo-tasks-backend`'s `test_temp_dir()` helper reads it explicitly, keeping fixtures out of the
checkout and Cargo `target` tree.
### Threads
Each thread is a Worker running the same module over the same shared memory, entered through the
......@@ -98,7 +107,6 @@ workaround for this host:
|---|---|
| `no unwinding on wasm` | wasm is `panic = abort`, so `catch_unwind` never catches and a panic takes the whole instance down. Affects `#[should_panic]` tests and tests asserting panic isolation. |
| `parking_lot cannot block on wasm` | `parking_lot_core` only has a working thread parker behind its `nightly` feature, and the pinned version cannot compile it on current nightly. Blocking on a contended lock panics with "Parking not supported on this platform". |
| `no temp directory on WASI` | `std::env::temp_dir()` is unsupported on WASI preview1, so anything using `TempDir` panics. |
The `parking_lot` limitation is worth calling out: it is not only a test problem. Until it is fixed,
any contended lock panics on wasm, which Turbopack itself would hit. The no-unwinding limitation is
......
......@@ -17,6 +17,17 @@ export const WASI_MEMORY_INITIAL_PAGES = 536_870_912 / WASM_PAGE_SIZE_BYTES
// 4 GiB. Keep in sync with --max-memory in .cargo/config.toml.
export const WASI_MEMORY_MAXIMUM_PAGES = 4_294_967_296 / WASM_PAGE_SIZE_BYTES
/** Guest path mapped to the host's real temporary directory by the test runner. */
export const WASI_TEST_TEMP_DIR = '/tmp'
/** Build the environment and preopens shared by the main instance and all pthread instances. */
export function createWasiTestEnvironment(env, cwd, hostTempDir) {
return {
env: { ...env, TMPDIR: WASI_TEST_TEMP_DIR },
preopens: { '/': cwd, [WASI_TEST_TEMP_DIR]: hostTempDir },
}
}
/** Create the imported shared memory configured by the wasm32-wasip1-threads linker flags. */
export function createImportedMemory() {
return new WebAssembly.Memory({
......
......@@ -11,9 +11,14 @@
import { WASI } from 'node:wasi'
import { readFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import process from 'node:process'
import { createImportedMemory, createReadCustomSection } from './lib.mjs'
import {
createImportedMemory,
createReadCustomSection,
createWasiTestEnvironment,
} from './lib.mjs'
import { createThreadRuntime } from './spawn.mjs'
const [wasmPath, ...testArgs] = process.argv.slice(2)
......@@ -29,13 +34,18 @@ const memory = createImportedMemory()
// argv[0] is the program name, as a C `main` expects.
const args = [wasmPath, ...testArgs]
const { env, preopens } = createWasiTestEnvironment(
process.env,
process.cwd(),
tmpdir()
)
const wasi = new WASI({
version: 'preview1',
args,
env: process.env,
// Tests may touch the filesystem (tempfiles, fixtures); expose the working directory only.
preopens: { '/': process.cwd() },
env,
// The checkout remains available at `/`; `/tmp` maps to the host's actual temp directory.
preopens,
returnOnExit: true,
})
......@@ -50,8 +60,8 @@ const { threadSpawn } = createThreadRuntime({
memory,
threadIds,
args,
env: process.env,
cwd: process.cwd(),
env,
preopens,
onError: (error, threadId) => {
// A thread that dies takes the process with it, like a real aborted thread would.
const suffix = threadId === undefined ? '' : ` ${threadId}`
......
......@@ -52,7 +52,7 @@ export function nextThreadId(threadIds) {
* main wasm thread is parked in `Atomics.wait`. All managers allocate IDs from the same shared
* counter.
*
* @param {{ module: WebAssembly.Module, memory: WebAssembly.Memory, threadIds: Int32Array, args: string[], env: Record<string, string>, cwd: string, onError: (error: Error, threadId: number | undefined) => void, workerPath?: string, WorkerClass?: typeof Worker, ThreadManagerClass?: typeof ThreadManager }} context
* @param {{ module: WebAssembly.Module, memory: WebAssembly.Memory, threadIds: Int32Array, args: string[], env: Record<string, string>, preopens: Record<string, string>, onError: (error: Error, threadId: number | undefined) => void, workerPath?: string, WorkerClass?: typeof Worker, ThreadManagerClass?: typeof ThreadManager }} context
*/
export function createThreadRuntime(context) {
const {
......@@ -61,7 +61,7 @@ export function createThreadRuntime(context) {
threadIds,
args,
env,
cwd,
preopens,
onError,
workerPath = THREAD_WORKER,
WorkerClass = Worker,
......@@ -82,7 +82,7 @@ export function createThreadRuntime(context) {
reuseWorker: false,
onCreateWorker: () =>
new WorkerClass(workerPath, {
workerData: { threadIds, args, env, cwd },
workerData: { threadIds, args, env, preopens },
// Inherit stdio so panics and test output from threads reach the terminal.
stdout: false,
stderr: false,
......
......@@ -13,7 +13,7 @@ import { parentPort, workerData } from 'node:worker_threads'
import { createReadCustomSection } from './lib.mjs'
import { createThreadRuntime } from './spawn.mjs'
const { threadIds, args, env, cwd } = workerData
const { threadIds, args, env, preopens } = workerData
const handler = new ThreadMessageHandler({
postMessage: (message) => parentPort.postMessage(message),
......@@ -26,7 +26,7 @@ const handler = new ThreadMessageHandler({
version: 'preview1',
args,
env,
preopens: { '/': cwd },
preopens,
returnOnExit: true,
})
......@@ -38,7 +38,7 @@ const handler = new ThreadMessageHandler({
threadIds,
args,
env,
cwd,
preopens,
onError: (error, threadId) => {
const suffix = threadId === undefined ? '' : ` ${threadId}`
console.error(`wasi thread${suffix} failed:`, error)
......
......@@ -228,10 +228,10 @@ mod tests {
use std::fs;
use rstest::rstest;
use tempfile::TempDir;
use turbo_persistence::CurrentDbVersion;
use super::*;
use crate::utils::test_temp_dir::test_temp_dir;
const CURRENT_VERSION: &str = "mock-version";
......@@ -273,12 +273,11 @@ mod tests {
#[rstest]
#[case::not_ci(false, &["mock-version", "other-dir-0"])]
#[case::ci(true, &["mock-version"])]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_only_most_recently_used_other_version_is_retained(
#[case] is_ci: bool,
#[case] expected: &[&str],
) {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
// the least recently used of all, and preserved anyway
......@@ -301,9 +300,8 @@ mod tests {
/// A version that hasn't been used within the TTL is evicted, even with the retention slot
/// free.
#[test]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_ttl_evicts_unused_version() {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
create_version_dir(base_path, CURRENT_VERSION, Duration::ZERO);
......@@ -323,9 +321,8 @@ mod tests {
#[rstest]
#[case::empty(false)]
#[case::with_recent_data_file(true)]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_version_without_stamp_is_evicted(#[case] with_data_file: bool) {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
create_version_dir(base_path, CURRENT_VERSION, Duration::ZERO);
......@@ -347,9 +344,8 @@ mod tests {
#[rstest]
#[case::old_u32_format(&0u32.to_be_bytes())]
#[case::garbage(b"not json")]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_unparsable_current_falls_back_to_mtime(#[case] contents: &[u8]) {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
create_version_dir(base_path, CURRENT_VERSION, Duration::ZERO);
......@@ -371,12 +367,11 @@ mod tests {
ttl_from_days(DEFAULT_OTHER_DB_VERSION_TTL_DAYS) + Duration::from_secs(60),
&["mock-version"],
)]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_current_with_unknown_fields_uses_its_commit_time(
#[case] committed_ago: Duration,
#[case] expected: &[&str],
) {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
create_version_dir(base_path, CURRENT_VERSION, Duration::ZERO);
......@@ -401,9 +396,8 @@ mod tests {
/// The age of an unparsable `CURRENT` comes from its mtime, so it's a real age that the TTL
/// can act on — not [`Duration::MAX`], which would evict it unconditionally.
#[test]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_unparsable_current_is_aged_by_mtime() {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let legacy = tmp_dir.path().join("legacy-version");
fs::create_dir(&legacy).unwrap();
fs::write(legacy.join("CURRENT"), 0u32.to_be_bytes()).unwrap();
......@@ -425,9 +419,8 @@ mod tests {
/// On CI every other version is evicted regardless of age, so the mtime fallback doesn't buy a
/// legacy-format database a reprieve there.
#[test]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_ci_evicts_unreadable_current() {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
create_version_dir(base_path, CURRENT_VERSION, Duration::ZERO);
......@@ -441,9 +434,8 @@ mod tests {
}
#[test]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
fn test_cleanup_of_prefixed_items() {
let tmp_dir = TempDir::new().unwrap();
let tmp_dir = test_temp_dir().unwrap();
let base_path = tmp_dir.path();
for i in 0..5 {
......
......@@ -543,6 +543,7 @@ mod tests {
use crate::{
BackingStorageOptions,
database::{turbo::TurboKeyValueDatabase, write_batch::WriteBuffer},
utils::test_temp_dir::test_temp_dir,
};
/// Options used by these tests. `is_short_session` disables background compaction, which
......@@ -589,9 +590,8 @@ mod tests {
/// This is a lower-level test that verifies the database layer correctly handles
/// the case where multiple task IDs are stored under the same hash key.
#[tokio::test(flavor = "multi_thread")]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
async fn test_hash_collision_returns_multiple_candidates() -> Result<()> {
let tempdir = tempfile::tempdir()?;
let tempdir = test_temp_dir()?;
let path = tempdir.path();
let db = TurboKeyValueDatabase::new(path.to_path_buf(), TEST_STORAGE_OPTIONS)?;
......@@ -624,9 +624,8 @@ mod tests {
// This test is too slow to run under Miri.
#[cfg(not(miri))]
#[tokio::test(flavor = "multi_thread")]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
async fn test_batch_write_with_flush_and_reopen() -> Result<()> {
let tempdir = tempfile::tempdir()?;
let tempdir = test_temp_dir()?;
let path = tempdir.path();
let n = 100_000;
......@@ -685,9 +684,8 @@ mod tests {
/// single id it deletes, so anything else in the bucket is untouched whether or not this
/// commit knows about it.
#[tokio::test(flavor = "multi_thread")]
#[cfg_attr(target_family = "wasm", ignore = "no temp directory on WASI")]
async fn test_save_snapshot_delete_tombstones_task() -> Result<()> {
let tempdir = tempfile::tempdir()?;
let tempdir = test_temp_dir()?;
let path = tempdir.path();
let collision_hash: u64 = 0xC0FFEE;
......
......@@ -6,5 +6,7 @@ pub mod ptr_eq_arc;
pub mod shard_amount;
pub mod stopwatch;
pub mod swap_retain;
#[cfg(test)]
pub(crate) mod test_temp_dir;
pub use swap_retain::swap_retain;
//! A temporary directory for tests that also works on WASI.
//!
//! `std::env::temp_dir()` is unconditionally unsupported on WASI — it panics with "not supported by
//! WASI yet" rather than consulting `TMPDIR` — so `tempfile::tempdir()`, which asks it where to put
//! the directory, aborts every test that uses it.
//!
//! The filesystem itself is fine: the WASI test host pre-opens the host's real temporary directory
//! and exposes its guest path through `TMPDIR`. Creating a private directory there keeps test
//! debris out of the checkout while remaining reachable from every WASI pthread instance.
use std::io;
use tempfile::TempDir;
#[cfg(target_family = "wasm")]
const WASM_TEMP_DIR_ENV: &str = "TMPDIR";
/// Creates a temporary directory that is removed when the returned [`TempDir`] is dropped.
///
/// Prefer this over [`tempfile::tempdir`] in tests: it behaves identically on native targets and
/// additionally works on WASI, where the system temporary directory does not exist.
pub(crate) fn test_temp_dir() -> io::Result<TempDir> {
#[cfg(not(target_family = "wasm"))]
let dir = tempfile::tempdir()?;
#[cfg(target_family = "wasm")]
let dir = {
let base = std::env::var_os(WASM_TEMP_DIR_ENV).ok_or_else(|| {
io::Error::new(
io::ErrorKind::NotFound,
format!("WASI test host did not provide {WASM_TEMP_DIR_ENV}"),
)
})?;
tempfile::Builder::new().tempdir_in(base)?
};
Ok(dir)
}
#[cfg(test)]
mod tests {
use super::test_temp_dir;
#[test]
fn creates_a_private_test_directory() {
let dir = test_temp_dir().expect("test temp directory should be available");
assert!(dir.path().is_dir());
#[cfg(target_family = "wasm")]
assert!(
dir.path().starts_with(
std::env::var_os(super::WASM_TEMP_DIR_ENV)
.expect("WASI test host should provide TMPDIR")
)
);
}
}
......@@ -186,7 +186,10 @@ mod tests {
#[should_panic(expected = "Max id limit (overflow)")]
// wasm has no unwinding (panic = abort), so a panic aborts the process instead of being caught
// and `#[should_panic]` can never pass. See the `wasi-test-host` README.
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
fn test_overflow_detection() {
let factory = IdFactory::new(NonZeroU8::MIN, NonZeroU8::MAX);
assert_eq!(factory.get(), NonZeroU8::new(1).unwrap());
......@@ -198,7 +201,10 @@ mod tests {
#[test]
#[should_panic(expected = "Max id limit (overflow)")]
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
fn test_overflow_detection_near_u64_max() {
let factory = IdFactory::new(NonZeroU64::try_from(u64::MAX - 5).unwrap(), NonZeroU64::MAX);
for _ in 0..=6 {
......
......@@ -375,7 +375,10 @@ mod tests {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
// Relies on `catch_unwind` catching, which needs unwinding; wasm is panic = abort.
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
async fn test_panic_in_scope() {
let result = catch_unwind(AssertUnwindSafe(|| {
let mut input = vec![1; 1000];
......
......@@ -450,7 +450,10 @@ mod tests {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
// Relies on `catch_unwind` catching, which needs unwinding; wasm is panic = abort.
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
async fn test_panic_in_scope_factory() {
let result = catch_unwind(AssertUnwindSafe(|| {
let _results = scope_bounded(1000, |scope| {
......@@ -470,7 +473,10 @@ mod tests {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
// Relies on `catch_unwind` catching, which needs unwinding; wasm is panic = abort.
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
async fn test_panic_in_scope_task() {
let result = catch_unwind(AssertUnwindSafe(|| {
let _results = scope_bounded(1000, |scope| {
......
......@@ -975,7 +975,10 @@ mod tests {
#[test]
#[cfg(debug_assertions)]
#[should_panic(expected = "TaskId exceeds 31 bits")]
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
fn task_output_panics_on_out_of_range_task_id() {
// `TASK_ID_MAX + 1` is the first value that sets bit 31.
// SAFETY: non-zero.
......@@ -986,7 +989,10 @@ mod tests {
#[test]
#[cfg(debug_assertions)]
#[should_panic(expected = "TaskId exceeds 31 bits")]
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
fn task_cell_panics_on_out_of_range_task_id() {
// SAFETY: non-zero.
let task = unsafe { TaskId::new_unchecked(TASK_ID_MAX + 1) };
......@@ -997,7 +1003,10 @@ mod tests {
#[test]
#[cfg(debug_assertions)]
#[should_panic(expected = "exceeds")]
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
fn cell_id_panics_on_out_of_range_type_id() {
// SAFETY: `MAX_VALUE_TYPE_ID + 1` is non-zero.
let type_id = unsafe { ValueTypeId::new_unchecked(CellId::MAX_VALUE_TYPE_ID + 1) };
......@@ -1006,7 +1015,10 @@ mod tests {
#[test]
#[cfg(debug_assertions)]
#[should_panic(expected = "exceeds")]
#[cfg_attr(target_family = "wasm", ignore = "no unwinding on wasm")]
#[cfg_attr(
target_family = "wasm",
ignore = "no unwinding on wasm: std is built panic=abort, so catch_unwind cannot catch"
)]
fn cell_id_panics_on_out_of_range_index() {
let type_id = unsafe { ValueTypeId::new_unchecked(1) };
let _ = CellId::new(type_id, CellId::MAX_CELL_INDEX + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment