Skip to content

Commit 5b3612b

Browse files
test: Remove dialer_can_receive stream muxer test (#3108)
Various muxer implementations struggle to fulfill this test. In practice, it doesn't matter much because we always run `multistream-select` on top of a newly negotiated stream so we never end up actually reading from a stream that we have never written to. Relevant discussion: kpp#27 (comment)
1 parent 0f5c491 commit 5b3612b

File tree

3 files changed

+0
-44
lines changed

3 files changed

+0
-44
lines changed

muxers/mplex/tests/compliance.rs

-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ async fn close_implies_flush() {
99
libp2p_muxer_test_harness::close_implies_flush(alice, bob).await;
1010
}
1111

12-
#[async_std::test]
13-
async fn dialer_can_receive() {
14-
let (alice, bob) =
15-
libp2p_muxer_test_harness::connected_muxers_on_memory_transport::<MplexConfig, _, _>()
16-
.await;
17-
18-
libp2p_muxer_test_harness::dialer_can_receive(alice, bob).await;
19-
}
20-
2112
#[async_std::test]
2213
async fn read_after_close() {
2314
let (alice, bob) =

muxers/test-harness/src/lib.rs

-25
Original file line numberDiff line numberDiff line change
@@ -80,31 +80,6 @@ where
8080
.await;
8181
}
8282

83-
/// Verifies that the dialer of a substream can receive a message.
84-
pub async fn dialer_can_receive<A, B, S, E>(alice: A, bob: B)
85-
where
86-
A: StreamMuxer<Substream = S, Error = E> + Unpin,
87-
B: StreamMuxer<Substream = S, Error = E> + Unpin,
88-
S: AsyncRead + AsyncWrite + Send + Unpin + 'static,
89-
E: fmt::Debug,
90-
{
91-
run_commutative(
92-
alice,
93-
bob,
94-
|mut stream| async move {
95-
let mut buf = Vec::new();
96-
stream.read_to_end(&mut buf).await.unwrap();
97-
98-
assert_eq!(buf, b"PING");
99-
},
100-
|mut stream| async move {
101-
stream.write_all(b"PING").await.unwrap();
102-
stream.close().await.unwrap();
103-
},
104-
)
105-
.await;
106-
}
107-
10883
/// Verifies that we can "half-close" a substream.
10984
pub async fn read_after_close<A, B, S, E>(alice: A, bob: B)
11085
where

muxers/yamux/tests/compliance.rs

-10
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ async fn close_implies_flush() {
99
libp2p_muxer_test_harness::close_implies_flush(alice, bob).await;
1010
}
1111

12-
#[async_std::test]
13-
#[ignore] // Hangs forever, is this a harness bug? It passes if we try to write to the stream.
14-
async fn dialer_can_receive() {
15-
let (alice, bob) =
16-
libp2p_muxer_test_harness::connected_muxers_on_memory_transport::<YamuxConfig, _, _>()
17-
.await;
18-
19-
libp2p_muxer_test_harness::dialer_can_receive(alice, bob).await;
20-
}
21-
2212
#[async_std::test]
2313
async fn read_after_close() {
2414
let (alice, bob) =

0 commit comments

Comments
 (0)