From 81c6bb6ec2e1806d67cdde96ef49781271e9fee9 Mon Sep 17 00:00:00 2001 From: Marian Lobur Date: Fri, 9 Mar 2018 09:38:04 +0100 Subject: [PATCH] Fix broken gke regional logging test. --- test/e2e/instrumentation/logging/stackdrvier/basic.go | 7 +++++-- test/e2e/instrumentation/logging/utils/wait.go | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/test/e2e/instrumentation/logging/stackdrvier/basic.go b/test/e2e/instrumentation/logging/stackdrvier/basic.go index e7ace396a82a..865c9bf1a18e 100644 --- a/test/e2e/instrumentation/logging/stackdrvier/basic.go +++ b/test/e2e/instrumentation/logging/stackdrvier/basic.go @@ -162,8 +162,11 @@ var _ = instrumentation.SIGDescribe("Cluster level logging implemented by Stackd }() ginkgo.By("Waiting for events to ingest") - zone := framework.TestContext.CloudConfig.Zone - c := utils.NewLogChecker(p, utils.UntilFirstEntryFromZone(zone), utils.JustTimeout, "") + location := framework.TestContext.CloudConfig.Zone + 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) framework.ExpectNoError(err) }) diff --git a/test/e2e/instrumentation/logging/utils/wait.go b/test/e2e/instrumentation/logging/utils/wait.go index 5992f8ac1b20..ae4b1608bb84 100644 --- a/test/e2e/instrumentation/logging/utils/wait.go +++ b/test/e2e/instrumentation/logging/utils/wait.go @@ -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. -func UntilFirstEntryFromZone(zone string) IngestionPred { +func UntilFirstEntryFromLocation(location string) IngestionPred { return func(_ string, entries []LogEntry) (bool, error) { for _, e := range entries { - if e.Location == zone { + if e.Location == location { return true, nil } }