Complete first release candidate audit (#107)
Some checks failed
API and SemVer surface / api-surface (push) Failing after 1m34s
Native code generation / deterministic (push) Has been cancelled
Concurrency and resource soak audit / soak (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
performance evidence / audit (push) Has been cancelled
First release candidate / non-fuzz-release-gate (push) Has been cancelled
Release platform and feature matrix / audit (push) Has been cancelled
Release platform and feature matrix / matrix (false, linux-stable-minimal, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, macos-stable-portable, x86_64-apple-darwin, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, windows-stable-portable, x86_64-pc-windows-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-msrv-portable, x86_64-unknown-linux-gnu, 1.96.0) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-default, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-features, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-release-surface, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
Native release artifact audit / audit (push) Has been cancelled
Imaging and meshing gate / native (push) Failing after 53s
JPEG 2000 feature / linux (push) Successful in 2m49s
Native Rust workspace compile / compile (push) Failing after 59s
Skia feature / linux (push) Has been cancelled

This commit is contained in:
2026-08-12 14:44:28 +00:00
parent dceb394378
commit c9a1170a27
140 changed files with 82175 additions and 27179 deletions

View File

@@ -10,6 +10,15 @@ use std::sync::{Arc, Mutex};
use std::task::{Context, Poll, Wake, Waker};
use std::time::Duration;
const OPENSIM_LOGIN_OPTIONS: [&str; 6] = [
"avatar_picker_url",
"classified_fee",
"currency",
"destination_guide_url",
"profile-server-url",
"search",
];
/// Runs one test future without choosing an async runtime for the library.
pub fn block_on<F: Future>(future: F) -> F::Output {
struct ThreadWake(std::thread::Thread);
@@ -31,6 +40,121 @@ pub fn block_on<F: Future>(future: F) -> F::Output {
}
}
/// Tokio runtime kept alive for the complete lifetime of a live-grid fixture.
///
/// Network login starts UDP, capability, timer, and cancellation tasks. Keeping
/// this multi-thread runtime in the fixture lets those tasks continue running
/// while a synchronous compatibility assertion observes grid state.
pub struct LiveTestRuntime(tokio::runtime::Runtime);
impl LiveTestRuntime {
/// Creates a live-I/O runtime with all Tokio drivers enabled.
///
/// # Panics
///
/// Panics if worker threads or the runtime's I/O driver cannot be created.
#[must_use]
pub fn new() -> Self {
Self(
tokio::runtime::Builder::new_multi_thread()
.worker_threads(2)
.enable_all()
.build()
.expect("create live-grid Tokio runtime"),
)
}
/// Runs one live-grid future while retaining the runtime for background I/O.
pub fn block_on<F: Future>(&self, future: F) -> F::Output {
self.0.block_on(future)
}
}
impl Default for LiveTestRuntime {
fn default() -> Self {
Self::new()
}
}
/// Authenticates a test client against the exact `OpenSim` endpoint in `.env`.
///
/// The helper adds the `OpenSim` response options used by the dedicated smoke
/// program and retries only the server's explicit stale-session response. It
/// does not substitute a Second Life endpoint, region, or start location.
///
/// # Panics
///
/// Panics if parameters cannot be constructed or the dedicated account cannot
/// authenticate within 90 seconds.
pub fn login_live_grid(
runtime: &LiveTestRuntime,
client: &mut libremetaverse::GridClient,
channel: &str,
version: &str,
) -> libremetaverse::NetworkManager {
client.settings().timing().login_timeout = 30_000;
client.settings().timing().logout_timeout = 5_000;
// OpenSim sends inventory bootstrap and initial scene packets as part of
// login. These lazily constructed services must install their consumers
// before credentials cross the wire or that one-shot state is lost.
let _ = client.self_();
let _ = client.objects();
let _ = client.inventory();
let _ = client.assets();
let _ = client.appearance();
let _ = client.avatars();
let _ = client.grid();
let _ = client.estate();
let network = client.network();
let (first, last, password, login_url) = live_grid_credentials();
let deadline = std::time::Instant::now() + Duration::from_secs(90);
loop {
let mut login = network
.default_login_params(
first.clone(),
last.clone(),
password.clone(),
channel.to_owned(),
version.to_owned(),
)
.expect("NetworkManager DefaultLoginParams");
login.uri.clone_from(&login_url);
for option in OPENSIM_LOGIN_OPTIONS {
if !login.options.iter().any(|existing| existing == option) {
login.options.push(option.to_owned());
}
}
let logged_in = runtime
.block_on(network.login_with_login_params_cancellation_token(login, None))
.expect("NetworkManager LoginAsync");
if logged_in {
assert!(network.connected(), "client is not connected to the grid");
let simulator = network
.current_sim()
.expect("CurrentSim is null after successful OpenSim login");
client
.self_()
.complete_agent_movement(simulator)
.expect("complete OpenSim agent movement after login");
return network;
}
let message = network.login_message();
let stale_session = message.to_ascii_lowercase().contains("already logged in");
assert!(
stale_session && std::time::Instant::now() < deadline,
"OpenSim login failed: {message}"
);
std::thread::sleep(Duration::from_secs(5));
}
}
/// Performs the protocol logout while the live runtime is still active.
pub fn logout_live_grid(runtime: &LiveTestRuntime, client: &mut libremetaverse::GridClient) {
let network = client.network();
let _ = runtime.block_on(network.logout_with_cancellation_token(None));
let _ = client.dispose_with_method();
}
/// Loads the live-grid identity from the process environment or workspace `.env`.
///
/// # Panics