Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 6961cfa

Browse files
committed
various fixes related to stream/future cancellation
Most of this is related to the delay between queuing an event (e.g. read completion) and delivering it; a guest could cancel inbetween, and we should allow that rather than trap. Also, we need to be careful to invalidate any queued events as part of cancellation, especially given that the guest could cancel and close a stream or future before delivery. This code is getting uglier with time and will likely need to be cleaned up and refactored before it is upstreamed. Fixes #84 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent a5436cc commit 6961cfa

3 files changed

Lines changed: 351 additions & 195 deletions

File tree

crates/misc/component-async-tests/tests/scenario/streams.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use {
22
anyhow::Result,
3-
component_async_tests::{closed_streams, Ctx},
3+
component_async_tests::{closed_streams, util::init_logger, Ctx},
44
futures::future,
55
std::sync::{Arc, Mutex},
66
tokio::fs,
@@ -16,6 +16,8 @@ use {
1616

1717
#[tokio::test]
1818
pub async fn async_watch_streams() -> Result<()> {
19+
init_logger();
20+
1921
let mut config = Config::new();
2022
config.wasm_component_model(true);
2123
config.wasm_component_model_async(true);
@@ -141,6 +143,8 @@ pub async fn async_closed_streams_with_watch() -> Result<()> {
141143
}
142144

143145
pub async fn test_closed_streams(watch: bool) -> Result<()> {
146+
init_logger();
147+
144148
let mut config = Config::new();
145149
config.debug_info(true);
146150
config.cranelift_debug_verifier(true);

0 commit comments

Comments
 (0)