dev/system-run-cart #34

Merged
bquarkz merged 11 commits from dev/system-run-cart into master 2026-07-03 20:43:03 +00:00
Showing only changes of commit 95465869b1 - Show all commits

View File

@ -487,20 +487,15 @@ fn tick_asset_cancel_invalid_transition_returns_status_not_crash() {
runtime.initialize_vm(&mut log_service, &mut vm, &cartridge).expect("runtime must initialize");
let mut asset_ready = false;
for _ in 0..1_000 {
match platform.local_hardware().assets.status(handle) {
LoadStatus::READY => {
asset_ready = true;
break;
let start = Instant::now();
let mut status = platform.local_hardware().assets.status(handle);
while matches!(status, LoadStatus::PENDING | LoadStatus::LOADING)
&& start.elapsed() < std::time::Duration::from_secs(5)
{
std::thread::sleep(std::time::Duration::from_millis(10));
status = platform.local_hardware().assets.status(handle);
}
LoadStatus::PENDING | LoadStatus::LOADING => {
std::thread::yield_now();
}
other => panic!("unexpected asset status before commit: {:?}", other),
}
}
assert!(asset_ready, "asset did not become ready before commit");
assert_eq!(status, LoadStatus::READY, "asset did not become ready before commit");
assert_eq!(platform.local_hardware().assets.commit(handle), AssetOpStatus::Ok);
platform.local_hardware().assets.apply_commits();