tests/inst: Update tokio, hyper and nix
authorColin Walters <walters@verbum.org>
Wed, 7 Apr 2021 17:43:03 +0000 (17:43 +0000)
committerColin Walters <walters@verbum.org>
Wed, 7 Apr 2021 18:00:57 +0000 (18:00 +0000)
tests/inst/Cargo.toml
tests/inst/src/destructive.rs
tests/inst/src/test.rs

index 99ab4e8e9166eaeee30c488dd406f194c4cb3dae..bac4e42db70599a942c01499f46a01efe51f584e 100644 (file)
@@ -22,11 +22,11 @@ gio = "0.9"
 ostree = { version = "0.10.0", features = ["v2021_1"] }
 libtest-mimic = "0.3.0"
 twoway = "0.2.1"
-hyper = "0.13"
+hyper = { version = "0.14", features = ["runtime", "http1", "http2", "tcp", "server"] }
+hyper-staticfile = "0.6.0"
 futures = "0.3.4"
 http = "0.2.0"
-hyper-staticfile = "0.5.1"
-tokio = { version = "0.2", features = ["full"] }
+tokio = { version = "1.4.0", features = ["full"] }
 futures-util = "0.3.1"
 base64 = "0.12.0"
 procspawn = "0.8"
@@ -36,7 +36,7 @@ strum = "0.18.0"
 strum_macros = "0.18.0"
 openat = "0.1.19"
 openat-ext = "0.1.4"
-nix = "0.17.0"
+nix = "0.20.0"
 # See discussion in https://github.com/coreos/rpm-ostree/pull/2569#issuecomment-780569188
 rpmostree-client = { git = "https://github.com/coreos/rpm-ostree", tag = "v2021.3" }
 
index 562e1aed90fbbc2ba779664c1b3446e175898edd..d631b9a76c9bf76d47615b8dabe265cec2a9bc7d 100644 (file)
@@ -208,12 +208,13 @@ fn upgrade_and_finalize() -> Result<()> {
 
 async fn run_upgrade_or_timeout(timeout: time::Duration) -> Result<bool> {
     let upgrade = tokio::task::spawn_blocking(upgrade_and_finalize);
+    tokio::pin!(upgrade);
     Ok(tokio::select! {
         res = upgrade => {
             let _res = res?;
             true
         },
-        _ = tokio::time::delay_for(timeout) => {
+        _ = tokio::time::sleep(timeout) => {
             false
         }
     })
@@ -383,7 +384,7 @@ fn impl_transaction_test<M: AsRef<str>>(
 
     assert_ne!(commitstates.booted.as_str(), commitstates.target.as_str());
 
-    let mut rt = tokio::runtime::Runtime::new()?;
+    let rt = tokio::runtime::Runtime::new()?;
     let cycle_time_ms = (tdata.cycle_time.as_secs_f64() * 1000f64 * FORCE_REBOOT_AFTER_MUL) as u64;
     // Set when we're trying an interrupt strategy that isn't a reboot, so we will
     // re-enter the loop below.
index 11d23ab75534d250e419d02884158936d56c21c5..81592f7a41da4e5422910276037fa5e99fed4cc0 100644 (file)
@@ -158,7 +158,7 @@ where
     F: Send + 'static,
 {
     let path = path.as_ref();
-    let mut rt = Runtime::new()?;
+    let rt = Runtime::new()?;
     rt.block_on(async move {
         let addr = http_server(path, *opts).await?;
         tokio::task::spawn_blocking(move || f(&addr)).await?