Skip to content

Commit 2ce5e91

Browse files
authored
Merge pull request rust-lang#976 from rust-lang/arise-from-the-ashes
Test that coordinator is still usable after idling
2 parents c0ec2f4 + 52deee1 commit 2ce5e91

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

compiler/base/orchestrator/src/coordinator.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,32 @@ mod tests {
19131913
Ok(())
19141914
}
19151915

1916+
#[tokio::test]
1917+
#[snafu::report]
1918+
async fn test_still_usable_after_idle() -> Result<()> {
1919+
let mut coordinator = new_coordinator().await;
1920+
1921+
let req = ExecuteRequest {
1922+
channel: Channel::Stable,
1923+
mode: Mode::Debug,
1924+
edition: Edition::Rust2021,
1925+
crate_type: CrateType::Binary,
1926+
tests: false,
1927+
backtrace: false,
1928+
code: r#"fn main() { println!("hello") }"#.into(),
1929+
};
1930+
1931+
let res = coordinator.execute(req.clone()).await.unwrap();
1932+
assert_eq!(res.stdout, "hello\n");
1933+
1934+
coordinator.idle().await.unwrap();
1935+
1936+
let res = coordinator.execute(req).await.unwrap();
1937+
assert_eq!(res.stdout, "hello\n");
1938+
1939+
Ok(())
1940+
}
1941+
19161942
trait TimeoutExt: Future + Sized {
19171943
#[allow(clippy::type_complexity)]
19181944
fn with_timeout(

0 commit comments

Comments
 (0)