Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken gke regional logging test. #60968

Merged
merged 1 commit into from Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/e2e/instrumentation/logging/stackdrvier/basic.go
Expand Up @@ -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 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't multi-zone different from regional? What the Zone value will be in regional case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU this parameter is true for both of this cases in test env:
https://github.com/kubernetes/test-infra/blob/master/jobs/config.json#L7093

In case of regional ZONE is just a random zone from region.

location = framework.TestContext.CloudConfig.Region
}
c := utils.NewLogChecker(p, utils.UntilFirstEntryFromLocation(location), utils.JustTimeout, "")
err := utils.WaitForLogs(c, ingestionInterval, ingestionTimeout)
framework.ExpectNoError(err)
})
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/instrumentation/logging/utils/wait.go
Expand Up @@ -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
}
}
Expand Down