mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-05 22:53:34 -04:00
wait for open port when setting up metadata storage for accounts tests
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -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"
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user