ci: unfreeze wasm tests from rustc 1.88.0#7537
Conversation
|
Please also revert #7518 . |
|
These annotations are only for a small section of the failing wasm tests, which yields: I plan on opening PRs for the remaining sections to it split up based on module, unless it is preferred to aggregate all annotations here |
|
Thank you for the PR!
I think we would want to have 1 PR (1 commit), instead of having multiple commits of this. Having some large file changes for this is fine with me. |
ignore-wasm to failing wasm testsignore-wasm to failing wasm tests
|
Test results yield: |
|
Now the doc test is hitting Lines 463 to 475 in 925c614 (it looks like You could update the cfgs in the ci settings like this: - cargo test -p tokio --target ${{ matrix.target }} --features full
+ cargo test -p tokio --target ${{ matrix.target }} --features "sync,macros,io-util,rt,time" |
8fb85d5 to
ab2a5f5
Compare
There was a problem hiding this comment.
See #7537 (comment), It might be a cargo issue, we'd better having a minimal reproducible example, otherwise, it is hard for me to say that I know what I am doing.
|
I made an minimal reproducible example, it seems unrelated to neither Rust version nor wasm. If I understand correctly, since there is a @mox692 Do you have any idea? It look like a Cargo issue. [package]
name = "feature-flag"
version = "0.1.0"
edition = "2024"
[dependencies]
[features]
epoll = []
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(my_unstable)'] }// src/lib.rs
#[cfg(all(
not(my_unstable),
any(
feature = "epoll",
)
))]
compile_error!("blablabla");# no error
RUSTFLAGS="--cfg my_unstable" cargo +1.88 test --lib --features epoll
RUSTFLAGS="--cfg my_unstable" cargo +1.89 test --lib --features epoll
# compilation error
RUSTFLAGS="--cfg my_unstable" cargo +1.88 test --doc --features epoll
RUSTFLAGS="--cfg my_unstable" cargo +1.89 test --doc --features epoll |
|
Not sure. It looks like cfg isn't passed to cargo properly. It's probably worth filing an issue on cargo side? |
|
@ADD-SP This does not trigger # no error on --doc
RUSTFLAGS="--cfg my_unstable" RUSTDOCFLAGS="--cfg my_unstable" cargo +1.88 test --doc --features epoll
RUSTFLAGS="--cfg my_unstable" RUSTDOCFLAGS="--cfg my_unstable" cargo +1.89 test --doc --features epoll
# no error on --lib
RUSTFLAGS="--cfg my_unstable" cargo +1.88 test --lib --features epoll
RUSTFLAGS="--cfg my_unstable" cargo +1.89 test --lib --features epollIf we run RUSTDOCFLAGS="--cfg my_unstable" cargo +1.88 test --doc --features epoll
Compiling foo v0.1.0 (/.../foo)
error: blablabla
--> src/lib.rs:8:1
|
8 | compile_error!("blablabla");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not compile `foo` (lib) due to 1 previous errorRUSTFLAGS="--cfg my_unstable" cargo +1.88 test --doc --features epoll
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.19s
Doc-tests foo
error: blablabla
--> src/lib.rs:8:1
|
8 | compile_error!("blablabla");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error
error: doctest failed, to rerun pass `--doc`I believe this boils down to how running |
ADD-SP
left a comment
There was a problem hiding this comment.
I think there are several tests don't need to be ignore-wasm, we could enable it.
By the way, and not a blocker, I think its ok to remove the async fn main in the rendered docs.
/// # /*
/// #[tokio::main]
/// # */
/// # #[tokio::main(flavor = "current_thread")]
/// async fn main() {
/// let mut none = stream::empty::<i32>();
///
/// assert_eq!(None, none.next().await);
/// }
///
So we can do this, and it looks less confusing while reading the tokio source.
/// # #[tokio::main(flavor = "current_thread")]
/// async fn main() {
/// let mut none = stream::empty::<i32>();
///
/// assert_eq!(None, none.next().await);
/// # }
///
| /// `SyncIoBridge`. | ||
| /// | ||
| /// ```rust | ||
| /// ```rust,ignore-wasm |
There was a problem hiding this comment.
I initially couldn't get this test to be enabled until I lowered the memory allocated in the test from 64KiB to 16KiB, specifically for the threads runner.
I tried using futures::executor::block_on and adjusting the max memory limit of the test in RUSTFLAGS but neither seemed to work. Neither did simply adjusting the flavor to current_thread.
Not sure what the deeper problem is there. Except maybe it's just due to the single-threaded execution?
|
I removed tokio/tokio-stream/src/stream_ext.rs Lines 515 to 518 in 58f199e tokio/tokio-util/src/io/sync_bridge.rs Lines 107 to 110 in 58f199e |
ADD-SP
left a comment
There was a problem hiding this comment.
I think there are still some doc tests should not be disabled on wasm, this is still not a exhausted list, you might find more by scanning this PR.
I use this screenshot to illustrate my concerns.
I rendered the docs of tokio::task using this PR. Using too many exclamation marks in docs can make it a less enjoyable read for downstream.
|
There's 108 tests remaining that still have Although, a common exception to this are these tests, for example, with blocking mechanisms (marked by |
ignore-wasm to failing wasm tests
Addresses failing wasm tests: #7519
Motivation
Currently, the MSRV is pinned temporarily and there is a large amount of failures for wasm doctests with the Rust 1.89.0 release.
Solution
Add
ignore-wasmto failing doctests until these tests pass with the new release.Apply
flavor = current_threadtotokio::mainmacro to enable single-threaded execution on WASM tests.Partially enable WASM tests using conditional compilation.