We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afc091d commit 2000d5eCopy full SHA for 2000d5e
core/src/polling_monitor/mod.rs
@@ -368,10 +368,14 @@ mod tests {
368
monitor.monitor(REQ);
369
drop(rx);
370
let mut next = handle.next_request().await;
371
- if let Some((a, _)) = next {
+ if let Some((req, responder)) = next {
372
// The request may or may not have been pulled from the queue
373
// before cancelation.
374
- assert_eq!(REQ, a);
+ assert_eq!(REQ, req);
375
+ // Explicitly complete the request so the monitor task can process it
376
+ // and detect the cancellation. Dropping the responder without responding
377
+ // is racy in a multi-threaded runtime.
378
+ responder.send_error(anyhow!("cancelled"));
379
next = handle.next_request().await;
380
}
381
assert!(next.is_none());
0 commit comments