diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bb5eb6e688..512ea2df46 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -88,7 +88,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Test - run: cargo test ${{ matrix.features }} + run: cargo test ${{ matrix.features }} -- --nocapture - name: Test all benches if: matrix.benches diff --git a/tests/client.rs b/tests/client.rs index c4bc80c2cc..9b1bddbdc2 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -2055,16 +2055,19 @@ mod conn { .await .expect("write 1"); let _ = done_rx.await; + eprintln!("bye server"); }); // make polling fair by putting both in spawns tokio::spawn(async move { + eprintln!("client start"); let io = tcp_connect(&addr).await.expect("tcp connect"); let (mut client, conn) = conn::http1::Builder::new() .handshake::<_, Empty>(io) .await .expect("http handshake"); + eprintln!("client connected"); let mut conn = std::pin::pin!(conn); // get the conn ready @@ -2073,6 +2076,7 @@ mod conn { .is_pending()); assert!(client.is_ready()); + eprintln!("client send1"); // use the connection once let mut fut1 = std::pin::pin!(client.send_request(http::Request::new(Empty::new()))); let _res1 = future::poll_fn(|cx| loop { @@ -2089,32 +2093,39 @@ mod conn { assert!(client.is_ready()); + eprintln!("client trigger server end"); // simulate the server dropping the conn let _ = done_tx.send(()); // let the server task die // a full sleep might needed to make Windows happy tokio::time::sleep(Duration::from_millis(10)).await; + eprintln!("client slept"); let mut fut2 = std::pin::pin!(client.try_send_request(http::Request::new(Empty::new()))); let poll1 = future::poll_fn(|cx| Poll::Ready(fut2.as_mut().poll(cx))).await; assert!(poll1.is_pending(), "not already known to error"); + eprintln!("client try_send 2"); // wasn't a known error, req is in queue, and now the next poll, the // conn will be noticed as errored let mut err = future::poll_fn(|cx| { loop { + eprintln!("client try_send poll loop"); if let Poll::Ready(res) = fut2.as_mut().poll(cx) { return Poll::Ready(res); } match conn.as_mut().poll(cx) { - Poll::Ready(_) => continue, // ok + Poll::Ready(c) => { + eprintln!("conn result: {:?}", c); + } // ok Poll::Pending => return Poll::Pending, }; } }) .await .expect_err("resp 2"); + eprintln!("client error 2"); assert!(err.take_message().is_some(), "request was returned"); })