From 19053c3be020aac03d4b49585f3ffd87f8150cea Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Mon, 4 Mar 2019 13:19:11 -0500 Subject: [PATCH] swarm/network/stream: more debug output --- swarm/network/stream/snapshot_retrieval_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/swarm/network/stream/snapshot_retrieval_test.go b/swarm/network/stream/snapshot_retrieval_test.go index 430065e501..35be546c80 100644 --- a/swarm/network/stream/snapshot_retrieval_test.go +++ b/swarm/network/stream/snapshot_retrieval_test.go @@ -115,7 +115,7 @@ var retrievalSimServiceMap = map[string]simulation.ServiceFunc{ syncUpdateDelay := 1 * time.Second if *longrunning { - syncUpdateDelay = 15 * time.Second + syncUpdateDelay = 5 * time.Second } r := NewRegistry(addr.ID(), delivery, netStore, state.NewInmemoryStore(), &RegistryOptions{ @@ -145,7 +145,7 @@ func runFileRetrievalTest(nodeCount int) error { sim := simulation.New(retrievalSimServiceMap) defer sim.Close() - log.Info("Initializing test config") + log.Info("Initializing test config", "node count", nodeCount) conf := &synctestConfig{} //map of discover ID to indexes of chunks expected at that ID @@ -163,6 +163,8 @@ func runFileRetrievalTest(nodeCount int) error { ctx, cancelSimRun := context.WithTimeout(context.Background(), 3*time.Minute) defer cancelSimRun() + log.Info("Starting simulation") + result := sim.Run(ctx, func(ctx context.Context, sim *simulation.Simulation) error { nodeIDs := sim.UpNodeIDs() for _, n := range nodeIDs { @@ -190,6 +192,8 @@ func runFileRetrievalTest(nodeCount int) error { return err } + log.Info("network healthy, start file checks") + // File retrieval check is repeated until all uploaded files are retrieved from all nodes // or until the timeout is reached. REPEAT: @@ -217,6 +221,8 @@ func runFileRetrievalTest(nodeCount int) error { } }) + log.Info("Simulation terminated") + if result.Error != nil { return result.Error }