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:
1 parent
368fb103f6
commit
df9fa95c9f
1 file changed
+11
@@ -3,6 +3,9 @@ package test
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"flag"
|
"flag"
|
||||||
|
"net"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/micro/cli/v2"
|
"github.com/micro/cli/v2"
|
||||||
"github.com/owncloud/ocis/storage/pkg/command"
|
"github.com/owncloud/ocis/storage/pkg/command"
|
||||||
mcfg "github.com/owncloud/ocis/storage/pkg/config"
|
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()}))
|
_ = 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