From da290e9707d6b3074b571722bbb557815b03ad48 Mon Sep 17 00:00:00 2001 From: Elad Date: Tue, 9 Oct 2018 14:08:40 +0200 Subject: cmd/swarm: speed up tests (#17878) These minor changes already shaved off around 30s. --- cmd/swarm/upload_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cmd/swarm/upload_test.go') diff --git a/cmd/swarm/upload_test.go b/cmd/swarm/upload_test.go index e8161680f..0ac2456a5 100644 --- a/cmd/swarm/upload_test.go +++ b/cmd/swarm/upload_test.go @@ -32,6 +32,7 @@ import ( "github.com/ethereum/go-ethereum/log" swarm "github.com/ethereum/go-ethereum/swarm/api/client" + "github.com/ethereum/go-ethereum/swarm/testutil" "github.com/mattn/go-colorable" ) @@ -298,8 +299,8 @@ func TestCLISwarmUpDefaultPath(t *testing.T) { } func testCLISwarmUpDefaultPath(toEncrypt bool, absDefaultPath bool, t *testing.T) { - cluster := newTestCluster(t, 1) - defer cluster.Shutdown() + srv := testutil.NewTestSwarmServer(t, serverFunc, nil) + defer srv.Close() tmp, err := ioutil.TempDir("", "swarm-defaultpath-test") if err != nil { @@ -323,7 +324,7 @@ func testCLISwarmUpDefaultPath(toEncrypt bool, absDefaultPath bool, t *testing.T args := []string{ "--bzzapi", - cluster.Nodes[0].URL, + srv.URL, "--recursive", "--defaultpath", defaultPath, @@ -340,7 +341,7 @@ func testCLISwarmUpDefaultPath(toEncrypt bool, absDefaultPath bool, t *testing.T up.ExpectExit() hash := matches[0] - client := swarm.NewClient(cluster.Nodes[0].URL) + client := swarm.NewClient(srv.URL) m, isEncrypted, err := client.DownloadManifest(hash) if err != nil { -- cgit v1.2.3