Fix tests

This commit is contained in:
Jeff Mitchell 2017-05-25 09:00:49 -04:00
parent df33f70df4
commit 72a5b5e23b
4 changed files with 4 additions and 9 deletions

View File

@ -82,7 +82,7 @@ func TestGenerateRoot_status(t *testing.T) {
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
}
if !strings.Contains(string(ui.OutputWriter.Bytes()), "Started: true") {
if !strings.Contains(ui.OutputWriter.String(), "Started: true") {
t.Fatalf("bad: %s", ui.OutputWriter.String())
}
}

View File

@ -182,7 +182,7 @@ func TestRekey_status(t *testing.T) {
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
}
if !strings.Contains(string(ui.OutputWriter.Bytes()), "Started: true") {
if !strings.Contains(ui.OutputWriter.String(), "Started: true") {
t.Fatalf("bad: %s", ui.OutputWriter.String())
}
}

View File

@ -243,8 +243,8 @@ func TestWrite_Output(t *testing.T) {
if code := c.Run(args); code != 0 {
t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String())
}
if !strings.Contains(string(ui.OutputWriter.Bytes()), "Key") {
t.Fatalf("bad: %s", string(ui.OutputWriter.Bytes()))
if !strings.Contains(ui.OutputWriter.String(), "Key") {
t.Fatalf("bad: %s", ui.OutputWriter.String())
}
}

View File

@ -1418,11 +1418,6 @@ func (c *Core) runStandby(doneCh, stopCh, manualStepDownCh chan struct{}) {
default:
}
// Clear forwarding clients
c.requestForwardingConnectionLock.Lock()
c.clearForwardingClients()
c.requestForwardingConnectionLock.Unlock()
// Create a lock
uuid, err := uuid.GenerateUUID()
if err != nil {