Skip to content

Commit

Permalink
Expect TeleportReadyEvent to be emitted when DB proxy run in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakule committed Feb 7, 2022
1 parent 1c071ef commit e660a99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integration/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,8 @@ func (i *TeleInstance) StartDatabase(conf *service.Config) (*service.TeleportPro
conf.UploadEventsC = i.UploadEventsC
conf.Auth.Enabled = false
conf.Proxy.Enabled = false
conf.Apps.Enabled = false
conf.SSH.Enabled = false

// Create a new Teleport process and add it to the list of nodes that
// compose this "cluster".
Expand All @@ -844,6 +846,7 @@ func (i *TeleInstance) StartDatabase(conf *service.Config) (*service.TeleportPro
expectedEvents := []string{
service.DatabasesIdentityEvent,
service.DatabasesReady,
service.TeleportReadyEvent,
}

// Start the process and block until the expected events have arrived.
Expand Down Expand Up @@ -1102,6 +1105,9 @@ func (i *TeleInstance) Start() error {
if i.Config.Apps.Enabled {
expectedEvents = append(expectedEvents, service.AppsReady)
}
if i.Config.Databases.Enabled {
expectedEvents = append(expectedEvents, service.DatabasesReady)
}

// Start the process and block until the expected events have arrived.
receivedEvents, err := startAndWait(i.Process, expectedEvents)
Expand Down

0 comments on commit e660a99

Please sign in to comment.