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
chore(logging): handle TestListLogEntriesRequest flakiness #5460
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of things
c716a7c
to
6c8a02b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple more error reports to flip
logging/logadmin/logadmin_test.go
Outdated
} | ||
filterTime, err := time.Parse(time.RFC3339, strings.Trim(got.Filter[len(timeFilterPrefix):], "\"")) | ||
if err != nil { | ||
t.Errorf("%v: expect default filter to have time in RFC3339; got %v", err, got.Filter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got, want
logging/logadmin/logadmin_test.go
Outdated
|
||
// Default is client's project ID, 24 hour lookback, and no orderBy. | ||
if !testutil.Equal(got.ResourceNames, []string{"projects/PROJECT_ID"}) || got.OrderBy != "" || timeDiff.Hours() < 24 { | ||
t.Errorf("expect {\"projects/PROJECT_ID\"} resource names, 24 hour look back filter and native order\ngot %v", got) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got, want
remove timestamp comparison which fails due to (milli-)seconds mismatch when executing time.Now() to get filter time delayed after time.Now() in the test. separately test default (-24h) look back period
align error message with expected format refactor testing params for TestListLogEntriesRequest
0712c55
to
2f54167
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
remove timestamp comparison which fails due to (milli-)seconds mismatch when executing time.Now() to get filter time delayed after time.Now() in the test.
separately test default (-24h) look back period.
Fixes #5441