-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async I/O support + ALPN #127
Conversation
I went through the PR and it looks good to me, but I don't feel qualified to approve the async-related changes since I hardly have experience with async in rust. @jethrogb are you planning to review this? |
This will need significant changes after landing #128 which will come first |
9151be6
to
219f287
Compare
Wrong target branch for the PR (or wrong rebase target) |
This should target v0.6 but 0.6 was master when I opened the PR I think. I'll close this PR for now. |
219f287
to
b91d916
Compare
Can this be rebased on 0.8? |
I think it would not be straightforward to rebase this. I'll have to spend some time and do that separately. |
Is there any progress on this? It's blocking other work we need. |
bors try |
Yes, there are some tests failed |
Also add the full test command to ct.sh (without it, tests execute)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good to me, but I found misleading test behavior and provided a fix in #225 so that tokio tests actually run in 2.28.0 (see my comment).
Edit: I am not suggesting we update to 2.28.0 in this PR, only that we add the feature and the cargo command.
Edit 2: Finally, this PR can be updated to mbedtls-sys 2.28.0, see the continuation of this thread and #225
mbedtls/Cargo.toml
Outdated
[[test]] | ||
name = "async_session" | ||
path = "tests/async_session.rs" | ||
required-features = ["std", "threading", "tokio", "tokio/net", "tokio/io-util", "tokio/macros"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the below, I believe we should add tokio/rt
to this list, and make sure the test actually runs in CI with cargo test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros,tokio/rt
Note 1: I did update to mbedtls-sys 2.28.0 to pick up #152 and being able to actually test. See the diff here (a PR to this PR)
Edit: see @Taowyoo's comment below. My comment above still applies, but not for the reasons below.
Note 2: For the following, added an assert!(false)
to the very beginning of the client_server_test
so it FAILS.
When I runcargo test test::client_server_test
(no features),cargo
says the test ranok
(I was expecting filtered out, or FAIL, so this is either bad tokio usage in the test suite, or very misleading cargo behavior (might be cargo, see Note above) ❌When I runcargo test test::client_server_test --features=std,threading,tokio,tokio/net
,cargo
says the test ranok
(so, same as 1) ❌When I runcargo test test::client_server_test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros
(the features specified here), I finally get a compilation error sayingThe #[tokio::test] macro requires rt or rt-multi-thread.
✔️When I runcargo test test::client_server_test --features=std,threading,tokio,tokio/net,tokio/io-util,tokio/macros,tokio/rt
, the test is finally ran, resulting in the expected FAILURE. ✔️When I addtokio/rt
to the above list in line 95, the test is not run in my machine by any of the commands given inct.sh
, but they do parse it and reportok
as if it had passed. ❌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I think the problem should because we have two tests both has name test::client_server_test
, and the logic of using cargo test TEST_NAME
is equals to run cargo test
but also ask cargo
to only run tests whose name includes TEST_NAME
. And if you check the output of cargo test test::client_server_test
there is no lines of Running tests/async_session.rs ...
The more accurate way is cargo test --test async_session
Then cargo
will alert:
error: target `async_session` in package `mbedtls` requires the features: `std`, `threading`, `tokio`, `tokio/net`, `tokio/io-util`, `tokio/macros`, `tokio/rt`
Consider enabling them by passing, e.g., `--features="std threading tokio tokio/net tokio/io-util tokio/macros tokio/rt"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting this. I did not realize we have two tests with the same name. This explains all.
So, we still need to add tokio/rt
to the required dependencies as per my comment, and also make sure the test runs in CI by putting the command in ct.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
I updated related CI script in #225
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will review there.
tryBuild failed: |
Fix by updating certs with aws.com's certs chain
1. cfg macro related errors 2. wrong type error
Fix error by explicitly specify version for some deps
update ci to be similar to master version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
After review and suggested changes addressed by @Taowyoo, this looks good to me.
I will give a tentative approval, subject to @mzohreva agreeing on #225.
I reviewed @Taowyoo's commits in #225. It includes:
- Updating to mbedtls-sys 2.28.0
- Make sure tests run on CI
- Fix CI and build
The plan (again, subject to @mzohreva agreeing to #225) is to either
- Approve definitely this PR, and decline it in favor of Merge async support branch to 0.7 rust-mbedtls #224 which contains all the backported commits that succeeded this PR (everything reviewed). Merge 224.
- Incorporate the changes in Merge async support branch to 0.7 rust-mbedtls #224 here (already reviewed) and merge 127.
@zugzwang |
225: Update to mbedtls-sys 2.28, update test keys, and make sure async tests are run r=Taowyoo a=zugzwang Co-authored-by: francisco <[email protected]> Co-authored-by: Yuxiang Cao <[email protected]>
bors r+ |
Build succeeded:
|
224: Merge async support branch to 0.7 rust-mbedtls r=Taowyoo a=Taowyoo This is the successor PR for #127 but with some more latest changes needed Co-authored-by: Raoul Strackx <[email protected]> Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Yuxiang Cao <[email protected]>
224: Merge async support branch to 0.7 rust-mbedtls r=Taowyoo a=Taowyoo This is the successor PR for #127 but with some more latest changes needed Co-authored-by: Raoul Strackx <[email protected]> Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Co-authored-by: Yuxiang Cao <[email protected]>
No description provided.