Skip to content
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

Match test node type to test build type #442

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

HCastano
Copy link
Collaborator

While working on #437 I ran into an issue where my tests were failing because they
expected my node to have been built in release mode. This is because the tests helpers
were previously hardcoded to expect a release binary and nothing else.

This PR changes that behaviour so that the test helpers will now expect a binary
depending on the build type of the tests. I.e, if you're building your tests in debug
mode it expect a debug node, and if you built them in release mode it expects a release
node.

It also adds a couple more checks in case you don't have the right node type built.

@vercel
Copy link

vercel bot commented Oct 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
entropy-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2023 5:24pm


let proc = TestNodeProcess::<EntropyConfig>::build(path.as_str(), chain_type)
let proc = TestNodeProcess::<EntropyConfig>::build(path, chain_type)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future we can probably have the TestNodeProcess and builder take a Path instead, but I didn't want to mess with that here

@JesseAbram
Copy link
Member

tbh I don't love this as I warn people not to build the chain in debug type, I have seen a lot of errors as blockchains are time dependent and you can get weird failures when you aren't optimizing the build

@HCastano
Copy link
Collaborator Author

For development it's totally reasonable to build in debug mode though.

And this doesn't remove the ability for people to run in release mode, it just makes that more explicit and less error prone.

@HCastano HCastano merged commit 0dbcf5d into master Oct 23, 2023
5 checks passed
@HCastano HCastano deleted the hc-provide-test-node-build-flexibility branch October 23, 2023 15:15
@ameba23
Copy link
Contributor

ameba23 commented Nov 9, 2023

Is this working for people? My end, the server tests almost always fail when entropy is built in debug mode.

So in practice this change means i have to always build server in release mode to run the tests, which slows things down.

Since i am mostly working on server, for me it would be most convenient to build server in debug mode and run tests against a release build of entropy.

@HCastano

@HCastano
Copy link
Collaborator Author

HCastano commented Nov 9, 2023

@ameba23 all the server tests pass on my end using debug mode (on an admittedly fast laptop). Which tests are failing for you?

Having a hard requirement on needing release builds for tests to pass seems like a failure of our testing process. Everything should always be able to pass in debug mode.

@ameba23
Copy link
Contributor

ameba23 commented Nov 9, 2023

@ameba23 all the server tests pass on my end using debug mode (on an admittedly fast laptop). Which tests are failing for you?

Pretty much all of them fail whilst trying to get the rpc here:

eg:

thread 'user::tests::test_register_with_private_key_visibility' panicked at /home/turnip/radish/src/entropy/entropy-core/crypto/testing-utils/src/substrate_context.rs:55:10:
called `Result::unwrap()` on an `Err` value: "Failed to connect to node rpc at ws://127.0.0.1:9944 after 6 attempts: Rpc error: RPC error: Networking or low-level protocol error: Error when opening the TCP socket: Connection refused (os error 111)"

They do occasionally pass though.

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.

3 participants