Fix broken gke regional logging test.

This commit is contained in:
Marian Lobur 2018-03-09 09:38:04 +01:00
parent a0844c17bf
commit 81c6bb6ec2
2 changed files with 8 additions and 5 deletions

View File

@ -162,8 +162,11 @@ var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackd
}() }()
ginkgo.By("Waiting for events to ingest") ginkgo.By("Waiting for events to ingest")
zone := framework.TestContext.CloudConfig.Zone location := framework.TestContext.CloudConfig.Zone
c := utils.NewLogChecker(p, utils.UntilFirstEntryFromZone(zone), utils.JustTimeout, "") if framework.TestContext.CloudConfig.MultiZone {
location = framework.TestContext.CloudConfig.Region
}
c := utils.NewLogChecker(p, utils.UntilFirstEntryFromLocation(location), utils.JustTimeout, "")
err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout) err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
framework.ExpectNoError(err) framework.ExpectNoError(err)
}) })

View File

@ -55,12 +55,12 @@ func UntilFirstEntryFromLog(log string) IngestionPred {
} }
} }
// UntilFirstEntryFromZone is a IngestionPred that checks that at least one // UntilFirstEntryFromLocation is a IngestionPred that checks that at least one
// entry from the log with a given name was ingested. // entry from the log with a given name was ingested.
func UntilFirstEntryFromZone(zone string) IngestionPred { func UntilFirstEntryFromLocation(location string) IngestionPred {
return func(_ string, entries []LogEntry) (bool, error) { return func(_ string, entries []LogEntry) (bool, error) {
for _, e := range entries { for _, e := range entries {
if e.Location == zone { if e.Location == location {
return true, nil return true, nil
} }
} }