cmd/swarm/swarm-smoke: trigger debug even on successful smoke runs

This commit is contained in:
Anton Evangelatov 2019-03-15 17:07:25 +01:00
parent d9a6f0989b
commit 0fd51f1e01

View file

@ -44,7 +44,7 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error {
errc := make(chan error)
go func() {
errc <- uplaodAndSync(ctx, randomBytes, tuid)
errc <- uploadAndSync(ctx, randomBytes, tuid)
}()
select {
@ -65,6 +65,14 @@ func uploadAndSyncCmd(ctx *cli.Context, tuid string) error {
return e
}
// trigger debug functionality on randomBytes even on successful runs
err := trackChunks(randomBytes[:])
if err != nil {
log.Error(err.Error())
}
return nil
}
func trackChunks(testData []byte) error {
@ -134,7 +142,7 @@ func getAllRefs(testData []byte) (storage.AddressCollection, error) {
return fileStore.GetAllReferences(ctx, reader, false)
}
func uplaodAndSync(c *cli.Context, randomBytes []byte, tuid string) error {
func uploadAndSync(c *cli.Context, randomBytes []byte, tuid string) error {
log.Info("uploading to "+httpEndpoint(hosts[0])+" and syncing", "tuid", tuid, "seed", seed)
t1 := time.Now()