Skip to main content

Module rust_worker

Module rust_worker 

Source
Expand description

A Rust Worker a browser suite drives through wrangler dev.

The crate is instrumented in the suite’s copy and worker-build compiles it to wasm, where the region runtime keeps its region in linear memory behind two exports per crate: its address and a clear. Supercov points the copy’s wrangler configuration at an entry module that remembers every wasm instance the isolate creates, and at an inspector port of its own, so the suite’s own wrangler dev command is left as written. While the suite runs, a poller takes each instance’s region through the inspector and clears it every few milliseconds. Each take is a window, credited by time to the one browser test whose span it overlaps, as for a Go or JVM server; what no single test’s window holds is the run’s background.

Structs§

CargoTestWorkers
The Rust Workers a cargo test suite starts itself, with wrangler dev.
RustWorkerServer
The Rust Workers of one Cargo workspace a browser suite may start.

Constants§

REAL_WRANGLER
The program Supercov’s wrangler stands in for, named in the test processes’ environment.
WRANGLER_COMMAND
The hidden commands the stand-in and its poller run as.
WRANGLER_POLL_COMMAND

Functions§

launch_wrangler
Supercov’s wrangler: under a test, wrangler dev gets an inspector port and a poller writing into the test’s evidence; then this process becomes the real wrangler. The build it runs caps lints at warn, as for a Worker under a browser suite.
materialize_worker_windows
The Worker takes in a test’s evidence directory, written out as region files the run reads as it reads a native process’s; and the crates they came from, which wrangler dev built though the run’s own build did not. A take whose region names another instrumentation is not this run’s.
poll_wrangler
The poller of one wrangler dev a test started: takes through port while process pid – that wrangler – lives, appending to a .part file it renames to windows when done, so the run knows it is whole.