-
Notifications
You must be signed in to change notification settings - Fork 13
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
Improve overall test time #60
base: main
Are you sure you want to change the base?
Conversation
Looking good, thanks! It would be nice if we could specify a block number we'd like it to run to before proceeding as well. |
Could you elaborate a bit on "a block number we'd like it to run to"? |
Poll the current block of the spun up chain and yield after a block has been mined. |
You mean something like this? async fn block_hash(from: u64, to: u64, url: &str, timeout: u64) -> Result<Vec<Hash>, String>; |
core/tests/create_snapshot.rs
Outdated
let result = ChainApi::<(), Hash, Header, ()>::block_hash( | ||
&rpc, | ||
Some(ListOrValue::Value(NumberOrHex::Number(block_number))), | ||
) | ||
.await | ||
.map_err(|_| "Couldn't get block hash".to_string())?; |
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.
What I mean is by the time you get there, the block may not have been mined yet so probably needs to continue waiting after it has connected until confirmation that the target block is mined
I suspect this is due to we're running the tests in parallel now, spinning up multiple dev nodes at the same time. Any ideas? |
This would solve the issue, and the tests also run faster this way. But I'm not sure whether this is what you want. The logs are all mixed up as the tests run in parallel now. |
Currently, the tests run sequentially in separate processes. There are no problems because by the time the next test runs, the dev node has exited with the previous test process. After grouping the tests run in one process concurrently (different threads). The problem originates from setting the logger multiple times in a process, which is disallowed by the tracing crate. https://docs.rs/tracing-log/latest/tracing_log/log_tracer/struct.SetLoggerError.html Making the tests run sequentially (either with lock or TL;DR Grouping the tests has the benefits of faster compilation (-1min) and execution (-3min), but if running tests in parallel on the same node isn't what you want, let's revert the changes. |
The rough idea of what we talked about. :)) @liamaharon