-
Notifications
You must be signed in to change notification settings - Fork 447
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
fix: fix E2E test failures in Ink contracts #1876
fix: fix E2E test failures in Ink contracts #1876
Conversation
meant to be a draft, not a PR yet. |
5454a92
to
79debad
Compare
This commit addresses the issue where e2e-tests for ink contracts are failing even with the correct substrate-contracts-node setup. Change made =========== - I've Introduced `tokio::task::spawn_blocking` to offload the task of reading the substrate process's output to a separate thread since the previous approach wasn't working. - I've used `std::sync::mpsc` channel to relay the extracted port from the reader thread back to the main async context. - I've improved the `find_substrate_port_from_output` function to ensure continuous reading of process output, in order to prevent potential blockages. Note: ===== For details on how to test this fix, please read the PR write up. Impact: ======= This commit addresses issue use-ink#1875
79debad
to
557c314
Compare
Hi guys, it's now ready for review. |
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.
Looking at your reproduction, in the issue/flipper/Cargo.toml
you are using the 4.2.1
released version of ink_e2e
on crates.io. This is not compatible with the latest substrate-contracts-node
release.
I would bet that if you change that to use ink
master then it will resolve the issue without these changes.
Our CI ensures that the master
branch can run all E2E tests against the latest substrate-contracts-node
Hi @ascjones, |
None of the The If you want to use e2e tests with any of the released If you want to use the latest Thank you for the detailed report and reproduction steps, but I don't think these changes are required. |
Hi @ascjones, |
@0xf333 we are considering a |
See #1884 for backport of fix, will do another |
Description
The e2e-tests for ink contracts were failing due to an issue with port parsing. This PR introduces:
tokio::task::spawn_blocking
to offload the task to a separate thread.std::sync::mpsc
channel to efficiently relay the extracted port information.What This Enables
You can now reliably execute e2e-tests for ink contracts.
Impacts
This pull request addresses issue #1875
Testing The Implemented Fix
Environment ==> **Linux**
/scenario_for_E2E_test_issue/test_PR_fix
and makesubstrate-contracts-node
andenv_setup.sh
executable/scenario_for_E2E_test_issue/test_PR_fix/flipper
:(Wait for the compilation to finish before proceeding to the next step.)
test_PR_fix
directory:env_setup.sh
bash script to:ink_e2e
insidethe
Cargo.toml
file in order to test this PR fix.Note: Make sure to use
source
instead of./
to ensure the CONTRACTS_NODE environment variable is properly set.Save the change and then go back to the
flipper
directory, and run these commands in the same order:clean
to clean the previous buildconrtact build --release
to compile the contract and include changes made inside the ink_e2e dependency.test --features e2e-tests
to run the E2E testFinally, after executing
cargo test --features e2e-tests
, make sure that the compilation completes entirely. If you encounter an interruption at:Run the command again. Occasionally in Rust, compilation may prematurely exit during heavy CPU load.
Result
Before the fix
before.mp4
After the fix
after.mp4