Skip to content

Commit

Permalink
wait for open port when setting up metadata storage for accounts tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Oct 23, 2020
1 parent 368fb10 commit df9fa95
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions accounts/pkg/indexer/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package test
import (
"context"
"flag"
"net"
"time"

"github.com/micro/cli/v2"
"github.com/owncloud/ocis/storage/pkg/command"
mcfg "github.com/owncloud/ocis/storage/pkg/config"
Expand All @@ -20,4 +23,12 @@ func setupMetadataStorage() {
}

_ = app.Command("storage-metadata").Run(cli.NewContext(&app, &flag.FlagSet{}, &cli.Context{Context: context.Background()}))

// wait until port is open
d := net.Dialer{Timeout: 5 * time.Second}
conn, err := d.Dial("tcp", "localhost:9125")
if err != nil {
panic("timeout waiting for storage")
}
conn.Close()
}

0 comments on commit df9fa95

Please sign in to comment.