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

cmd/swarm: speed up tests #17878

Merged
merged 1 commit into from
Oct 9, 2018
Merged

cmd/swarm: speed up tests #17878

merged 1 commit into from
Oct 9, 2018

Conversation

acud
Copy link
Member

@acud acud commented Oct 8, 2018

this PR addresses ongoing efforts to speed up travis in continuation to @fjl's PR #17854
we will continue to work on this in order to improve test run performance.

these minor changes already shaved off around 30s:
github.com/ethereum/go-ethereum/cmd/swarm 163.721s

@fjl
Copy link
Contributor

fjl commented Oct 9, 2018

One thing you could try is to reuse the test cluster across tests.

@acud
Copy link
Member Author

acud commented Oct 9, 2018

@fjl i think there's a number of things that we might be able to in order to speed things up. also, bringing the test clusters up and down could also be somewhat optimised.
i'm just not sure at the moment on how to imperatively reset the clusters without juggling and introducing ugly hacks.
in the meanwhile i think we can ship this and we'll invest more time into speeding things up

@nonsense nonsense added the swarm label Oct 9, 2018
@nonsense nonsense added this to the 1.8.18 milestone Oct 9, 2018
@nonsense nonsense self-requested a review October 9, 2018 09:47
@nonsense
Copy link
Member

nonsense commented Oct 9, 2018

@justelad if newTestCluster is considerably slower than testutil.NewTestSwarmServer, then please change it also in export_test.go.

@fjl
Copy link
Contributor

fjl commented Oct 9, 2018

But why does the cluster need a reset at all? The tests perform different high-level operations on a standard-ish swarm network. It shouldn't really matter whether that network was just started with no content. If you ran the same test scripts against a swarm instance connected to the main network, they should still work.

@nonsense
Copy link
Member

nonsense commented Oct 9, 2018

@fjl I agree with you, I would just merge this right away, and then pursue the change where we have a shared cluster among many tests.

@acud
Copy link
Member Author

acud commented Oct 9, 2018

if newTestCluster is considerably slower than testutil.NewTestSwarmServer, then please change it also in export_test.go.

this involves extending the the testutil.NewTestSwarmServer functionality with newTestCluster funtionality. since the test server provides a much smaller subset of features.

i support the change as long as there's no requirement for a clean database (e.g. - you might want to have a clean address book before each test runs). also there is the question of what happens when you start pumping data of different test runs into the cluster and the cluster will be syncing a lot of messages in regards to syncing and discovery - this might overcloud the benefits of the setup/teardown times and would need to be inspected closely.

@fjl fjl merged commit da290e9 into ethereum:master Oct 9, 2018
@acud acud deleted the speed-up-tests branch October 9, 2018 12:43
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