Skip to content

Conversation

@boquan-fang
Copy link
Contributor

@boquan-fang boquan-fang commented Aug 22, 2025

Release Summary:

Resolved issues:

Description of changes:

This PR implements stream tokio tests for dcQUIC.

For testing purpose, I need to implement a TestTlsProvider which implements the tls::Provider trait to use certs from s2n-quic-core to perform handshake. Furthermore, since tests don't require a event subscriber to do anything, I implemented a NoopSubscriber, which implements the event::Subscriber from dcQUIC and s2n-quic-coire traits to act as a test event subscriber. Those tests don't need a event query function to do anything, so I set up an empty query_event function to act as a input to the tests as well.

Tests that I implemented perform handshakes between dcQUIC endpoints using the client, server, and io providers from the psk directory.

Call-outs:

I was trying to write the multiple_shutdown_test() like:

#[tokio::test]
async fn multiple_shutdown_test() {
    let context = Context::new().await;
    let (mut client, server) = context.pair().await;

    for i in 0..3 {
        if i > 0 && cfg!(target_os = "macos") {
            assert_eq!(
                client.shutdown().await.unwrap_err().kind(),
                ErrorKind::NotConnected
            );
        } else {
            client.shutdown().await.unwrap();
        }
    }

    drop(server);
}

I verifies that the stream::tests::behavior::tcp::write::multiple_shutdown_test is working fine on my local Mac laptop. That is the expected behavior: when a tokio TcpStream was shutdown on my Mac laptop, it won't allow us to shut it down again and will emit a NotConnected error. However, the Github Action running on macos-latest behaves quite differently. A tokio TcpStream can be shutdown multiple times on macos-latest github action runner. In that case, I decide to not running that test on macos. Refer to this run for more information.

Testing:

All these tests should pass the CI.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@boquan-fang boquan-fang force-pushed the dcQUIC-tokio-stream-tests branch 2 times, most recently from 9bae9b1 to 979856a Compare August 25, 2025 15:48
@boquan-fang
Copy link
Contributor Author

NOTE:: #2774 already implement the Handshake trait for Client and Server Provider struct. This PR need to refactor according to that.

@boquan-fang boquan-fang force-pushed the dcQUIC-tokio-stream-tests branch 4 times, most recently from a582b32 to c824293 Compare September 5, 2025 22:03
seems like tracing::debug! doesn't show up. Use tracing::info! instead.

REVERT THIS COMMIT ONCE IT IS NO LONGER NEEDED!
@boquan-fang boquan-fang force-pushed the dcQUIC-tokio-stream-tests branch from c824293 to 81b2b59 Compare September 5, 2025 22:15
This reverts commit 81b2b59.

The CI should only fail on multiple_shutdown_test:

* I test that on my macOS and it is passing. Maybe the github action's
  MacOS runner is different?
* I want to see if this would pass the CI.
* I suspect that Github MacOS is not having the same behavior as other
  macOS.
* This change will most certainly needs to be reverted!
@boquan-fang boquan-fang force-pushed the dcQUIC-tokio-stream-tests branch from 732987f to 7b2c7ba Compare September 10, 2025 00:28
@boquan-fang boquan-fang marked this pull request as ready for review September 10, 2025 02:20
@boquan-fang boquan-fang enabled auto-merge (squash) September 15, 2025 20:23
@boquan-fang boquan-fang merged commit 4d384f9 into aws:main Sep 15, 2025
238 of 240 checks passed
@boquan-fang boquan-fang deleted the dcQUIC-tokio-stream-tests branch September 15, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants