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

Forward net_* rpc commands to the upstream #377

Merged
merged 3 commits into from
Sep 29, 2017

Conversation

adambabik
Copy link
Contributor

net_* commands are supported by infura and should be routed there.

Otherwise, as we don't run les service anymore when using the upstream node, calling net_listening will result in an error and Dapps will think that our node is offline.

nodeConfig, err := MakeTestNodeConfig(params.RinkebyNetworkID)
require.NoError(err)
for _, upstreamEnabled := range []bool{false, true} {
s.T().Logf("TestCallRPC with upstream: %t", upstreamEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's not add logging to tests. I actually want to clean up other tests that printing logs in similar way. Let's tests be tests, no the debug session runners.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If run without -v and successful it shouldn't print, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I hope so. But in Ci we still using -v, that means more lines to scrolling, and distract attention while looking for the real FAIL messages. Logs made with Logf visually similar to test failure messages, so they adds more confusion without any benefit. Anyway, let's deal with it in another PR.

go func(r rpcCall) {
defer wg.Done()
resultJSON := rpcClient.CallRaw(r.inputJSON)
r.validator(resultJSON)
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that's code existed before PR, but I'm not sure r.validator will work as expected when launched from goroutine. Seems like testify doesn't handle such cases correctly, but I might be wrong. Anyway, it's not to be fixed here, just to keep in mind that it might the an issue with this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not really sure why you think it won't work as expected. testify can handle running assertions in goroutines just fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

@adambabik because I spent yesterday an hour fighting the same problem in other test that needed to do assertions/require in goroutines :) It just doesn't print anything in case of error and it's not easy to spot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I usually run tests so that they fail first and then pass (so as they should be :D). It printed everything nicely and reported failure. Maybe the conditions were a little bit different? Hard to tell but here everything was ok.

Copy link
Contributor

@divan divan left a comment

Choose a reason for hiding this comment

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

LGTM, minor comments.

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.

2 participants