16212: Make test timeout more predictable by pulling image first.
[arvados.git] / lib / boot / cmd.go
index f2266d6b581a621f60e414d444875fd118a96f90..1abc93722d8b872cce0d524bf55f5277e6487a5c 100644 (file)
@@ -22,7 +22,7 @@ type supervisedTask interface {
        // done enough to satisfy a dependency relationship (e.g., the
        // service is running and ready). If the task starts a
        // goroutine that fails after Run returns (e.g., the service
-       // shuts down), it should call cancel.
+       // shuts down), it should call fail().
        Run(ctx context.Context, fail func(error), super *Supervisor) error
        String() string
 }
@@ -52,7 +52,6 @@ func (bootCommand) RunCommand(prog string, args []string, stdin io.Reader, stdou
        loader.SetupFlags(flags)
        versionFlag := flags.Bool("version", false, "Write version information to stdout and exit 0")
        flags.StringVar(&super.SourcePath, "source", ".", "arvados source tree `directory`")
-       flags.StringVar(&super.LibPath, "lib", "/var/lib/arvados", "`directory` to install dependencies and library files")
        flags.StringVar(&super.ClusterType, "type", "production", "cluster `type`: development, test, or production")
        flags.StringVar(&super.ListenHost, "listen-host", "localhost", "host name or interface address for service listeners")
        flags.StringVar(&super.ControllerAddr, "controller-address", ":0", "desired controller address, `host:port` or `:port`")
@@ -78,12 +77,15 @@ func (bootCommand) RunCommand(prog string, args []string, stdin io.Reader, stdou
 
        super.Start(ctx, cfg)
        defer super.Stop()
-       if url, ok := super.WaitReady(); ok {
-               fmt.Fprintln(stdout, url)
-               // Wait for signal/crash + orderly shutdown
-               <-super.done
-               return 0
-       } else {
+       url, ok := super.WaitReady()
+       if !ok {
                return 1
        }
+       // Write controller URL to stdout. Nothing else goes to
+       // stdout, so this provides an easy way for a calling script
+       // to discover the controller URL when everything is ready.
+       fmt.Fprintln(stdout, url)
+       // Wait for signal/crash + orderly shutdown
+       <-super.done
+       return 0
 }