From 9e0e8becfc75c6560b858dd0d4f5eb545f13cf18 Mon Sep 17 00:00:00 2001 From: Shiyas Mohammed <83513144+shiyasmohd@users.noreply.github.com> Date: Thu, 20 Feb 2025 20:43:30 +0530 Subject: [PATCH] chore(yamux): migrate tests from async-std to tokio Migrating tests in protocols/request-response from async_std to tokio as per #4449 Pull-Request: #5872. --- Cargo.lock | 2 +- muxers/yamux/Cargo.toml | 2 +- muxers/yamux/tests/compliance.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2b37e6d77c..02d1318ea35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3566,12 +3566,12 @@ dependencies = [ name = "libp2p-yamux" version = "0.47.0" dependencies = [ - "async-std", "either", "futures", "libp2p-core", "libp2p-muxer-test-harness", "thiserror 2.0.9", + "tokio", "tracing", "yamux 0.12.1", "yamux 0.13.4", diff --git a/muxers/yamux/Cargo.toml b/muxers/yamux/Cargo.toml index 98beb55982c..44fb12399c7 100644 --- a/muxers/yamux/Cargo.toml +++ b/muxers/yamux/Cargo.toml @@ -20,7 +20,7 @@ yamux013 = { version = "0.13.3", package = "yamux" } tracing = { workspace = true } [dev-dependencies] -async-std = { version = "1.7.0", features = ["attributes"] } +tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } libp2p-muxer-test-harness = { path = "../test-harness" } # Passing arguments to the docsrs builder in order to properly document cfg's. diff --git a/muxers/yamux/tests/compliance.rs b/muxers/yamux/tests/compliance.rs index 14d69952b0e..c671f95b7e7 100644 --- a/muxers/yamux/tests/compliance.rs +++ b/muxers/yamux/tests/compliance.rs @@ -1,6 +1,6 @@ use libp2p_yamux::Config; -#[async_std::test] +#[tokio::test] async fn close_implies_flush() { let (alice, bob) = libp2p_muxer_test_harness::connected_muxers_on_memory_ring_buffer::().await; @@ -8,7 +8,7 @@ async fn close_implies_flush() { libp2p_muxer_test_harness::close_implies_flush(alice, bob).await; } -#[async_std::test] +#[tokio::test] async fn read_after_close() { let (alice, bob) = libp2p_muxer_test_harness::connected_muxers_on_memory_ring_buffer::().await;