Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.

Commit

Permalink
Fix an issue in federation integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
shashidharatd committed Jan 9, 2018
1 parent 55290de commit effbdfb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/integration/framework/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,27 @@ func (f *FederationAPIFixture) NewClient(userAgent string) federationclientset.I
}

func startServer(t *testing.T, runOptions *options.ServerRunOptions, stopChan <-chan struct{}) error {
var port int
err := wait.PollImmediate(DefaultWaitInterval, wait.ForeverTestTimeout, func() (bool, error) {
port, err := framework.FindFreeLocalPort()
var err error
port, err = framework.FindFreeLocalPort()
if err != nil {
t.Logf("Error allocating an ephemeral port: %v", err)
return false, nil
}

runOptions.InsecureServing.BindPort = port
err = app.NonBlockingRun(runOptions, stopChan)
if err != nil {
t.Logf("Error starting the %s: %v", apiNoun, err)
return false, nil
}
return true, nil
})
if err != nil {
return fmt.Errorf("Timed out waiting for the %s: %v", apiNoun, err)
}

runOptions.InsecureServing.BindPort = port
runOptions.SecureServing.ServerCert.CertDirectory = "/tmp"
err = app.NonBlockingRun(runOptions, stopChan)
if err != nil {
t.Logf("Error starting the %s: %v", apiNoun, err)
return err
}
return nil
}

Expand Down

0 comments on commit effbdfb

Please sign in to comment.